Snow Leopard 上的 MacPorts:Python 安装似乎成功,但未安装非系统 Python
我已经通过 MacPorts 安装了 Python。根据 这个问题,/opt/local/bin 中的文件应该运行“正确的”Python 版本。然而,所有这些文件都是符号链接到:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/
直接从该文件夹运行它们(不使用符号链接)会运行 Apple 版本的 Python!
Python 2.6.6 (r266:84292, Jan 6 2011, 13:25:25)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
为了进行比较,运行 /usr/bin/python 显示的版本略有不同:
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
它们都是 Apple 版本!如何安装正确的版本?
I've installed Python via MacPorts. According to this question, the files in /opt/local/bin should run the "correct" Python version. However, all those files are symlinks to:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/
Running them directly from that folder (using no symlinks) runs an Apple build of Python!
Python 2.6.6 (r266:84292, Jan 6 2011, 13:25:25)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
For comparison, running /usr/bin/python shows a slightly different version:
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
They're both Apple builds! How do I install the correct version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了系统 Python(据我所知,Snow Leopard 上是 2.6.1)之外,没有“Apple 版本”。在这种情况下,ports 安装似乎按预期工作。对 Apple 的引用是对所使用的 GCC 的引用。
There are no "Apple builds" except the system Python (which is 2.6.1 on Snow Leopard, afai can deduce). The ports install seems to have worked as expected in this case. The reference to Apple is a reference to which GCC that was used.
我认为它正在运行您想要的构建。
macports 将所有内容安装在 /opt/local 中。所以
/opt/local/bin/python 是一个macport 发行版
。/usr/bin/python 是 mac os x 附带的预安装 python 发行版。
以下行是有关 gcc 构建的信息,用于构建 macport python 发行版。
如果您安装了多个版本的 macport python,您可以使用 python-select 选择版本
另外,为了确保您使用 macport python,您可以将以下内容添加到 PATH
I think it is running the build you want.
macports install every thing in /opt/local. So
/opt/local/bin/python is a macport distribution
./usr/bin/python is pre-install python distribution that comes with mac os x.
The following line, is an information about gcc build which is used for building macport python distribution.
If you have multiple versions of macport python installed, you can select the version using python-select
Also to ensure that you use macport python you could add the following to the PATH