can't uninstall python3 in macOS

早过忘川 提交于 2020-05-31 06:19:23

问题


I am having trouble with my current python, so I wanted to uninstall my python and install the latest version. I installed with homebrew, so I uninstalled it with homebrew and reinstalled python 3.8.1 with the installer from the official site. Python3.8 was installed, but my python3 was not upgraded.

 ~ which python3                                      
/usr/bin/python3
 ~ python3 --version                                  
Python 3.7.3

I know I'm not supposed to(and I can't) manually delete things inside /usr/bin. What am I supposed to do?


回答1:


When you installed Python with homebrew it told you this:

Unversioned symlinks python, python-config, pip etc. pointing to python3, python3-config, pip3 etc., respectively, have been installed into /usr/local/opt/python/libexec/bin

If you need a reminder, post install, you will get the same message if you run:

brew info python

It says "unversioned links are in /usr/local/opt/python/libexec/bin". That means, if you want to run Python without specifying the version, i.e. if you want to type this:

python

and this:

pip

to start Python 3 and its corresponding pip, you need to make sure your PATH has /usr/local/opt/python/libexec/bin at the start, i.e.

export PATH=/usr/local/opt/python/libexec/bin:$PATH


来源:https://stackoverflow.com/questions/59748201/cant-uninstall-python3-in-macos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!