osx lion 上的默认 python

发布于 2024-12-14 07:38:46 字数 865 浏览 1 评论 0原文

问题是 osx python 使用默认命令 python。这意味着,例如,如果您从 macports 安装 py-pil,osx python 将找不到此模块。使用 macports 安装 python27 后,我可以使用名为 python-2.7 的命令。早些时候有一个名为 python_select 的实用程序,现在它完全消失了,看:

Romans-MacBook:~ holms$ ls /opt/local/bin/python*
/opt/local/bin/python2.7    /opt/local/bin/python2.7-config /opt/local/bin/pythonw2.7

Romans-MacBook:~ holms$ sudo port -v install python_select
--->  Cleaning python_select
--->  Removing work directory for python_select

我什至尝试从系统中完全删除 macports 并重新安装所有内容,仍然是相同的结果,python_select 徒劳地消失了。如果有人可以通过尝试下载 macports 并安装 python27 并使用 python_select 来确认这一点,那就太好了。因为我需要为某些软件编写一些 osx 的兼容性...并且很高兴知道 osx lion 中 python_select 的情况如何。

所以会有两个问题:

  1. lion中的python_select在哪里,
  2. 如何使默认的python命令使用macport python而不是osx one。

Problem is that default command python is used by osx python. That means for example if you install py-pil from macports, osx python won't find this module. after python27 installed with macports, I have command called python-2.7 available. Earlier there was utility called python_select now it's completely gone in a vain, look:

Romans-MacBook:~ holms$ ls /opt/local/bin/python*
/opt/local/bin/python2.7    /opt/local/bin/python2.7-config /opt/local/bin/pythonw2.7

Romans-MacBook:~ holms$ sudo port -v install python_select
--->  Cleaning python_select
--->  Removing work directory for python_select

I even tried to remove macports completely from system and reinstalled everything, still the same result, python_select is gone in a vain. If anybody could confirm this by trying to download macports and install python27 and use python_select it would be great. because I need to write some compability for osx for some software... and it would be great to know what's the situation with python_select in osx lion.

So there would be two questions:

  1. where is python_select in lion
  2. how to make default python command to use macport python and not osx one.

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

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

发布评论

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

评论(1

愚人国度 2024-12-21 07:38:46

MacPorts 删除了 python_select 功能,改用 port select

请参阅:

MacPorts removed the python_select functionality, use port select instead.

See:

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