easy_install 安装了各种版本的 python、mac osx
我在 mac OSX 10.6 机器上有各种版本的 python,其中一些是通过 macports 安装的:
> python_select -l
Available versions:
current none python24 python26 python26-apple python27
默认或系统版本是 python26-apple。我现在使用 python27,我
> sudo python_select python27
最近尝试使用 easy_install 安装 django,但它是使用默认 python 安装的(我可以通过 python_selecting python26-apple 并导入 django 来检查)。相反,如果我下载 django tarball,展开并使用
> sudo python setup.py install
一切都按预期工作,即我在 python 2.7 中得到 django。现在的问题是,有没有办法让 easy_install
与我使用 python_select
选择的 python 版本一起工作?
更新显然python_select
已被弃用。以下命令似乎是等效的:
port select --list python
生成:
Available versions for python:
none
python24
python26
python26-apple
python27 (active)
I have various versions of python on a mac OSX 10.6 machine, some of them installed with macports:
> python_select -l
Available versions:
current none python24 python26 python26-apple python27
The default or system version is python26-apple
. I am now using python27, which I selected with
> sudo python_select python27
I recently tried installing django using easy_install
, but it got installed with the default python (I can check that by python_selecting python26-apple and importing django). If, instead, I download the django tarball, expand and use
> sudo python setup.py install
everything works as expected, i.e. I get django in python 2.7. Now the question is, is there a way to get easy_install
to work with the version of python I have selected with python_select
?
UPDATE Apparently python_select
is deprecated. The following command seems to be equivalent:
port select --list python
producing:
Available versions for python:
none
python24
python26
python26-apple
python27 (active)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您希望“easy_install”与更新的 python 版本匹配,请按照以下步骤操作:
在 http:// 下载相应的 .egg 文件pypi.python.org/pypi/setuptools#files
像 shell 脚本一样运行它: sh setuptools-0.6c9-py2.7.egg
这将安装新的“easy_install”可执行文件,与您当前版本的 python 兼容。
希望这有帮助。
(更多详细信息请参见http://pypi.python.org/pypi/setuptools# cygwin-mac-os-x-linux-其他)
If you want your "easy_install" match your updated python version, follow these steps:
Download the corresponding .egg file at http://pypi.python.org/pypi/setuptools#files
Run it as if it were a shell script: sh setuptools-0.6c9-py2.7.egg
This will install the new "easy_install" executable, compatible with your current version of python.
Hope this helps.
(more details at http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other)
请务必在该 shell 脚本上使用 -prefix= 选项来控制 easy_install 版本的着陆位置。
Be sure to use the -prefix= option on that shell script to control where your easy_install version lands.