It seems like I messed up the system pip by pip3 install --upgrade pip
. Actually I even do not exactly remember whether I did upgrade or not.
Now when I try to use pip3
, it gives an error like
Traceback (most recent call last):
File "/Applications/Xcode.app/Contents/Developer/usr/bin/pip3", line 6, in <module>
from pip._internal import main
ImportError: cannot import name 'main' from 'pip._internal' (unknown location)
I tried sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
to revert back PIP by this answer, but it fails.
/Applications/Xcode.app/Contents/Developer/usr/bin/python3: No module named pip.__main__; 'pip' is a package and cannot be directly executed
which pip3
gives /usr/bin/pip3
Now I am trying to revert back the system tools and use virtual environment. What should I do? I can't even check which pip version is installed at the moment.
Thanks in advance.