我已经安装了Python 3.7.10,但是macOS在运行"python --version"时不断报告2.7.10



我对Python相当陌生,但我认为我需要指向新版本的Python,以便让我的系统知道安装了新版本。我在macOS 10.13.6上,用Homebrew的命令brew install python安装了最新的python。如有任何帮助,我们将不胜感激。

我试着遵循这个教程,但我被困在"确保路径…"这一部分,因为它往往会让我迷失方向:

# Do I have a Python 3 installed?
$ python --version
Python 3.6.4 # Success!
# If you still see 2.7 ensure in PATH /usr/local/bin/ takes precedence over /usr/bin/

尝试python3 --version

通常,您需要在终端中使用Python执行的任何操作的末尾添加3。

相关内容

最新更新