安装了python3,在终端中出现命令未找到错误

发布于 2024-09-26 21:59:24 字数 160 浏览 1 评论 0原文

我安装了 python3,我可以打开空闲,它说它正在运行 python3.0.1,但是当我在终端(在 OSX 上)中输入 python3 时,我收到一条错误消息,提示“找不到命令”。输入 python 会得到计算机上的 2.x 版本。关于如何从终端访问 python3 有什么建议吗?

谢谢

I installed python3, I can open idle and it says it is running python3.0.1, but when I enter python3 in the terminal (on OSX) I get an error saying 'command not found'. Entering python gets me the 2.x version that came on the computer. Any advice on how I can access python3 from the terminal?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

情独悲 2024-10-03 21:59:24

首先,不要使用Python 3.0.1。它存在很多问题,并在 Python 3.1(当前为 3.1.2)发布时正式退役。您可以在此处找到 3.1.2 的 python.org Mac OS X 安装程序。安装完成后,您需要确保 3.1.2 框架中的 bin 目录 (/Library/Frameworks/Python.framework/Versions/3.1/bin)位于您的 shell 搜索路径上。您可以手动修改适当的 shell 启动文件,例如 .bash_profile。或者只需双击 /Applications/Python 3.1 中的 Update Shell Profile.command。无论哪种情况,您都需要打开新的终端窗口或重新登录。另一种方法是从 MacPorts 或其他发行商安装 Python 3.1。此外,Python 3.2 的 alpha 版本现在可以从 python.org 和其他地方获得。

First, don't use Python 3.0.1. It has many problems and was officially retired upon the release of Python 3.1 (currently 3.1.2). You can find the python.org Mac OS X installer for 3.1.2 here. Once it is installed, then you need to ensure that the bin directory from the 3.1.2 framework (/Library/Frameworks/Python.framework/Versions/3.1/bin) is on your shell search path. You can manually modify an appropriate shell startup file, like .bash_profile. Or just double-click the Update Shell Profile.command found in /Applications/Python 3.1. In either case, you will need to open a new terminal window or re-login. Another approach is to install Python 3.1 from MacPorts or another distributor. Also, alpha releases of Python 3.2 are now available from python.org and elsewhere.

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