easy_install,安装了各种版本的python,mac osx [英] easy_install with various versions of python installed, mac osx
问题描述
我在Mac OSX 10.6机器上安装了各种版本的python,其中一些安装了macports:
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
默认或系统版本为python26-apple
.我现在正在使用我选择的python27
The default or system version is python26-apple
. I am now using python27, which I selected with
> sudo python_select python27
我最近尝试使用easy_install
安装django,但是它是使用默认python安装的(我可以通过python_selecting python26-apple并导入django进行检查).相反,如果我下载了Django tarball,请展开并使用
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
一切正常,也就是说,我在python 2.7中得到了django.现在的问题是,有没有办法让easy_install
与我在python_select
中选择的python版本一起使用?
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
?
更新显然已弃用python_select
.以下命令似乎是等效的:
UPDATE Apparently python_select
is deprecated. The following command seems to be equivalent:
port select --list python
生产:
Available versions for python:
none
python24
python26
python26-apple
python27 (active)
推荐答案
如果您希望"easy_install"与更新的python版本匹配,请按照以下步骤操作:
If you want your "easy_install" match your updated python version, follow these steps:
通过 http://pypi.python.org/pypi/setuptools#files 像运行shell脚本一样运行它:sh setuptools-0.6c9-py2.7.egg 这将安装新的"easy_install"可执行文件,与您当前的python版本兼容.
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.
希望这会有所帮助.
(更多详细信息,请参见 http://pypi.python.org/pypi /setuptools#cygwin-mac-os-x-linux-other )
(more details at http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other)
这篇关于easy_install,安装了各种版本的python,mac osx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!