简体   繁体   中英

Updating Python 3.8 not updating pip

On Mac Catalina 10.15.4 i had python 3.7 installed using homebrew. Uninstalled it and installed 3.8 using installer( not brew ). Updated pip and when i checked the version it is showing the warning pip is being invoked by an old script wrapper and advice me to use it with -m flag, and is showing the folder as /Users/username/Library/Python/3.7/lib/python/site-packages/pip(python 3.7) the version that i removed. I tried to uninstall pip using python3 -m pip uninstall pip and i am getting the following folders are going to be removed

/Library/Frameworks/Python.framework/Versions/3.8/bin/pip3 /Library/Frameworks/Python.framework/Versions/3.8/bin/pip3.8

ie; the newly installed version.

Is there a way to remove the old pip and use the one with 3.8.

I sorted out this problem by uninstalling the 3.8 version i installed using installer and installed the same version using homebrew. Then i updated my.zshrc with export PATH="/usr/local/opt/python@3.8/bin:$PATH" making it the default for python3. I had to revert back because so many programs just stopped working, like vim, mycli etc:- so i resorted to the easy way.

If somebody have the answer to install python3.8 from installer without harming other programs using python ( i have lots of them installed using brew and they will be looking for brew python) please let me know. It would have been great if those who have voted down have given their reasons in comments so that i can step back from repeating such mistakes.

Thanking all...

In my case, the only issue was an incorrect version in the Shebang of /usr/local/bin/pip , which was referencing the old Python version (3.7).

The following worked for me:

pip3 install --upgrade pip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM