python - 在终端中运行 python 会出现错误的版本

标签 python python-3.x bash

在我的终端中运行 python 时,它运行 Python 3.6,即使我最新的 python 版本是 3.8。我的 ~/.bash_profileexport PATH=/usr/local/bin:/usr/local/sbin:$PATH 和我的 ~/.bashrcalias python='/usr/bin/python3.8'

在终端中运行 python 时,有什么方法可以让它打开 Python 3.8?

我对Mac不太熟悉,我尝试过其他问题但无法解决。

最佳答案

你唯一应该做的就是:

ln -sf /usr/bin/python3.8 /usr/bin/python

关于python - 在终端中运行 python 会出现错误的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60133246/

相关文章:

python - 使用 BeautifulSoup 和 selenium 抓取特定的标签 html

python - 如何检测 Python 类中重复的方法名称?

python - 这个 numpy 高级索引代码是如何工作的?

python - 在 Windows 上设置 Python simpleHTTPserver

python - 在 Python 中获取介于最小值和最大值之间的值

python - 将现有的命令行脚本转换为Python中的GUI

python-3.x - 如何修复 python3 中的 CVE-2019-19646 Sqlite 漏洞

c++ - 为什么 bash 在进程死后不打印 "Broken pipe"日志?

linux - 如何获取路径的前两个目录

linux - bash中的for循环获取多个变量以在一个命令中使用它