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?