1

I am still a bit new to Python, and when installing various Python packages, I get an error AttributeError: module 'X' has no attribute 'Y', where X and Y are specific to that package. Most packages install without issues, but some are giving me this error. I have Python 3.8 installed on my Windows 10 64-bit, and, for example, when I try to install this package, I get this error:

C:\WINDOWS\system32>pip install micropython-warnings
Collecting micropython-warnings
  Using cached micropython-warnings-0.1.1.tar.gz (630 bytes)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\justinas\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\setup.py'"'"'; __file__='"'"'C:\\Users\\Justinas\\AppData\\Local\\Temp\\pip-install-1aq8t49t\\micropython-warnings\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Justinas\AppData\Local\Temp\pip-pip-egg-info-1od9eu5k'
         cwd: C:\Users\Justinas\AppData\Local\Temp\pip-install-1aq8t49t\micropython-warnings\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 17, in <module>
        import setuptools.version
      File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\version.py", line 1, in <module>
        import pkg_resources
      File "c:\users\justinas\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 3240, in <module>
        warnings.filterwarnings("ignore", category=PEP440Warning, append=True)
    AttributeError: module 'warnings' has no attribute 'filterwarnings'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

And this is quite common with lots of packages. How exactly do I fix this?

  • 2
    I think it has to do to packages versions missmarch; You can either go for an older stable version of Python, or an already set up Installation package environment like anaconda. – Petronella Oct 22 '20 at 11:16
  • @Petronella, Python 3.8 is considered unstable? I also have 3.7 installed, but I guess it doesn't help. How do I know which version I need to have installed to be able to use these packages? – Justinas Rubinovas Oct 22 '20 at 11:56
  • Python itself is not considered instabile, the packages versions that are compatible at Installation, the mix with the newest Python version might be instabile. If you have more version, be careful not to mix packages and versions, that's really bad – Petronella Oct 22 '20 at 13:05
  • maybe this can give you some ideas: https://stackoverflow.com/questions/61063676/command-errored-out-with-exit-status-1-python-setup-py-egg-info-check-the-logs – Petronella Oct 22 '20 at 13:12

0 Answers0