Recently, whenever I try to install a package using pip on Mac OS 10.15.6, the following happen :
- The installation is successful
- Now the module will never be able to be loaded, python will always return
ModuleNotFoundError
For exemple:
✗ pip install -U setuptools wheel
Collecting setuptools Using cached setuptools-49.6.0-py3-none-any.whl (803 kB)
Collecting wheel Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Installing collected packages: setuptools, wheel Attempting uninstall: setuptools Found existing installation: setuptools 47.1.0 Uninstalling setuptools-47.1.0: Successfully uninstalled setuptools-47.1.0
Successfully installed setuptools-49.6.0 wheel-0.35.1
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the '/Users/maeln/.pyenv/versions/3.8.5/bin/python3.8 -m pip install --upgrade pip' command.Setuptools was installed successfully. But now, when doing anything import setuptools:
pip install pycairo PyGObject
Collecting pycairo Using cached pycairo-1.19.1.tar.gz (205 kB) ERROR: Command errored out with exit status 1: command: /Users/maeln/.pyenv/versions/3.8.5/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8w/wqk8fyyj4k9fcq62thdz7cf00000gn/T/pip-install-cbernvg1/pycairo/setup.py'"'"'; __file__='"'"'/private/var/folders/8w/wqk8fyyj4k9fcq62thdz7cf00000gn/T/pip-install-cbernvg1/pycairo/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 /private/var/folders/8w/wqk8fyyj4k9fcq62thdz7cf00000gn/T/pip-pip-egg-info-7zmrjjql cwd: /private/var/folders/8w/wqk8fyyj4k9fcq62thdz7cf00000gn/T/pip-install-cbernvg1/pycairo/ Complete output (3 lines): Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'setuptools' ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.Worse ! If I dare try to update pip :
✗ /Users/maeln/.pyenv/versions/3.8.5/bin/python3.8 -m pip install --upgrade pip
Collecting pip Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 20.1.1 Uninstalling pip-20.1.1: Successfully uninstalled pip-20.1.1
Successfully installed pip-20.2.2
✗ pip
Traceback (most recent call last): File "/Users/maeln/.pyenv/versions/3.8.5/bin/pip", line 5, in <module> from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'I was using the brew version of python (right now 3.8.5). I try brew doctor, brew cleanup, removing all version of python installed and only installing python via brew install python and finally using pyenv now to no avail.
What could be the cause of this behavior ?
Reset to default