簡體   English   中英

安裝了各種版本的python的easy_install,mac osx

[英]easy_install with various versions of python installed, 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版本?

UPDATE顯然不推薦使用python_select 以下命令似乎是等效的:

port select --list python

生產:

Available versions for python:
    none
    python24
    python26
    python26-apple
    python27 (active)

如果您希望“easy_install”與更新的python版本匹配,請按照下列步驟操作:

http://pypi.python.org/pypi/setuptools#files下載相應的.egg文件。運行它就好像它是一個shell腳本:sh setuptools-0.6c9-py2.7.egg這將安裝新的“easy_install” “可執行文件,與您當前版本的python兼容。

希望這可以幫助。

(更多詳情請訪問http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other

請務必在該shell腳本上使用-prefix =選項來控制easy_install版本所在的位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM