1

I think I broke my pip after desperately trying to uninstall Python3.7. (I am on a Mac) I removed the python folder from the application, removed /Library/Frameworks/Python.framework and removed the folders from /usr/local/bin according to https://osxuninstaller.com/uninstall-guides/properly-uninstall-python-mac/. I then installed python3.6.

 src$ pip3.6 --version pip 9.0.1 from
 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
 (python 3.6)

but pip itself does no longer work.

src$ which pip 
/usr/local/bin/pip 
src$ pip --version
-bash: /Library/Frameworks/Python.framework/Versions/3.7/bin/pip: No such file or directory $

It still references the python 3.7 folder. How can I unlink that reference? THe same is btw. true for the package virtualenv that I installed. I can install it with pip3.6 but calling virtualenv still references to the framework folder of 3.7

user3554329
  • 111
  • 2
  • 11

1 Answers1

1

You need to install pip in that environment. i.e 3.7. Reason is when you deleted the default install you deleted the dependencies/ libraries that came with it.

Easiest way is to install python afresh via homebrew if you have it.

brew install python

Alternatively you can follow the instructions here to download a file to install pip securely. Homebrew can become messy when managing python environments. I'd recommend looking at something like anaconda if you are going to using different python versions with their own dependencies etc.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py

https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

Other options for fresh install are described in answer here. Hope that helps.

How do I install pip on macOS or OS X?

bamdan
  • 836
  • 7
  • 21