无法在macOS中卸载python3 [英] can't uninstall python3 in macOS

查看:97
本文介绍了无法在macOS中卸载python3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用当前的python时遇到问题,因此我想卸载python并安装最新版本.我安装了homebrew,所以我用homebrew卸载了它,并使用官方网站上的安装程序重新安装了python 3.8.1.已安装Python3.8,但我的python3尚未升级.

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

我知道我不应该(也不能)手动删除/usr/bin 中的内容.我该怎么办?

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

推荐答案

当您使用 homebrew 安装Python时,它会告诉您以下信息:

When you installed Python with homebrew it told you this:

未版本化的符号链接 python python-config pip 等指向分别是 python3 python3-config pip3 等.安装到/usr/local/opt/python/libexec/bin

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

它表示未版本转换的链接位于/usr/local/opt/python/libexec/bin 中" .这意味着,如果您要运行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

和这个:

pip

要启动Python 3及其对应的 pip ,您需要确保 PATH 具有/usr/local/opt/python/libexec/bin 开头,即

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

这篇关于无法在macOS中卸载python3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆