After installing python3, every pip install
ended up in error “No module named helpers” and when I tried installing “helpers” I got the same message. I Googled the issue and found this post but solution was linux related, thus, required some work to fix the issue on mac.
Firts I tried to see where python2.7 is on my system so I ran the following command
whereis python2.7
I was pointed to /usr/bin/python
, and when i checked the path, I see the following.
ls -l python
python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
python2 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
__Note:__Some items were removed from the list above.
Since the post was talking about site+packages, I tried to look for the folder but could not find it. Then i tried the command which python
(and also confirmed the python site-package folder path from stackoverflow as well), it s was
which python
/usr/local/bin/python
and the site-packages path was /usr/local/lib/python2.7/site-packages
. Now I modifed the provided/accepted solutoin in this post according to my paths.
rm -rf /usr/local/lib/python2.7/site-packages
python2.7 -m ensurepip
pip install --upgrade pip
Now, I tried to insatll packages again with pip, it worked. I hope this blow will help others.