【发布时间】:2020-06-09 11:40:47
【问题描述】:
Mac 最近将其终端 shell 从 bash 更新为 Zsh。作为一名 Python 程序员,我希望所有系统(包括终端和 IDE)的 Python 版本保持一致。
在 bash shell 上,要将终端中的 python 版本更新到 3.8.1,我遵循了以下过程
纳米~/.bash_profile
别名 python=python3
ctrl + x
是的
输入
这使我能够将 python 版本从 2.7.6 更新到 3.8.1。但是,对 zsh shell 重复相同的步骤并没有成功。尝试对上述过程进行调整,并以某种方式卡在 3.7.3
后续步骤
which python3 #Location of the python3.8.1 terminal command file is found。安装好了。
python --version #returned python 3.7.3
PS:我是python的绝对初学者,所以请在您的回复中考虑到这一点。我希望我没有浪费你的时间。
【问题讨论】:
-
您需要更新环境中的
PATH变量,使用zsh的配置文件而不是bash的配置文件。尝试apple.stackexchange.com 或unix.stackexchange.com 以获取有关如何执行此操作的建议;这不是 Stack Overflow 的主题。 -
alias python=python3不会更新任何内容。该别名只会导致 shell 将“python”解释为“python3”。
标签: python bash shell terminal zsh