Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
675 views
in Technique[技术] by (71.8m points)

macos - easy_install with various versions of python installed, mac osx

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...