我无法找到我的 python 路径(但能够找到 python3 路径)
我目前正在使用Mac Pro,并通过brew install python
为最新版本下载了Python(尽管下载了3.9.12而不是3.10.x)。
另外,在使用命令行时,我还安装了pyenv
(版本2.2.5)。
问题是,我现在无法获得默认的Python版本。 命令python - version
和python -h
都给了我zsh:找不到命令:python
。
但是,当我做python3 - version
时,它给了我python 3.9.12
。
我把事情弄乱了吗?在我更改任何东西之前,是否有办法回到州? (或至少恢复我的默认python
版本?)
I'm currently using Mac Pro and downloaded python through brew install python
for the latest version (though it downloaded 3.9.12 instead of 3.10.x).
Also, while playing with the command lines, I also installed pyenv
(version 2.2.5).
The problem is, I am now unable to get the default python version.
The command python --version
and python -h
all gives me zsh: command not found: python
.
However, when I do python3 --version
, it gives me Python 3.9.12
.
Did I mess things up? Is there are way to go back to the state before I altered anything? (or at least recover my default python
version?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在运行什么版本的MacOS?从12.3开始,将Python2从系统中删除。
https://developer.apple.apple.com/documentation/ macOS-REALE-NOTES/MACOS-12_3-REAlese-Notes
Python
贬值
在此更新中,将Python 2.7从MacOS中删除。开发人员应使用Python 3或替代语言。 (39795874)
What version of MacOS are you running? Starting in 12.3, Python2 was removed from the system.
https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes
Python
Deprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)