我无法找到我的 python 路径(但能够找到 python3 路径)

发布于 2025-01-18 15:00:10 字数 434 浏览 1 评论 0原文

我目前正在使用Mac Pro,并通过brew install python为最新版本下载了Python(尽管下载了3.9.12而不是3.10.x)。

另外,在使用命令行时,我还安装了pyenv(版本2.2.5)。

问题是,我现在无法获得默认的Python版本。 命令python - versionpython -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦开始←不甜 2025-01-25 15:00:10

您正在运行什么版本的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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文