I'm running macOS 11.2.2 Big Sur and I'm trying to get pip to work with the latest Python 3.9.4. This turned out to be ridiculously difficult even though I've read a number of articles on the subject. Possibly, it is the debris I accumulated in the system over the years which is causing me trouble. I need advice as to how to get things right again.
Checklist:
/usr/local/opt/python/bin/python3 --versionis Python 3.9.4 installed frombrewin the most usual way; it's a symlink to../Frameworks/Python.framework/Versions/3.9/bin/python3, which is inCellar.Both
pythonandpython3commands are aliased to/usr/local/opt/python/bin/python3, they give the correct version.I used both get-pip.py and ensurepip, and both of them say everything is fine: "Successfully installed pip-21.1.1 setuptools-56.0.0"
The only thing in
envthat has anything to do with Python is this part of PATH:/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin. The lack of this one is reported as warning when you install pip.
Still, I get this:
python -m pip --version
/usr/local/opt/python@3.9/bin/python3.9: No module named pip
What am I missing?
I also found this article that instructs to use pyenv, but running it on the latest macOS is yet another problem: pyenv install 3.9.4 doesn't build for some reason.