2013-03-09 100 views
0

我在我的Mac上用山獅運行python 3.3。我正在嘗試下載twitter api。大多數消息來源說使用點,這需要easy_install,這顯然我沒有。當終端我跑ñew-host-2:~ lego90511$ easy_install pip和響應,我得到錯誤:下載Python 3.3模塊

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-25628.write-test'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.

For information on other options, you may wish to consult the documentation at:

http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

:無法創建或安裝目錄

以下錯誤刪除的文件,同時嘗試添加或 安裝目錄中刪除文件時

有誰知道我在做什麼錯?

回答

1

這裏有兩個問題。一個是@garnertb提到的權限問題。 pip嘗試安裝在由root擁有的Python安裝包的站點中。

另一個問題是,你正在安裝到Apple的Python 2.7,你說你想要python 3.3。 enter link description here原因是easy_install在它的文本中包含它來自的python的目錄。只需輸入easy_install即可獲得第一個路徑,在這種情況下,該路徑看起來像是蘋果安裝的/usr/bin/easy_install。你得到的Python 3.3,你必須給它的完整路徑取決於你如何安裝的Python 3.3

中的easy_install的pip install page

Warning We advise against using easy_install to install pip

其建議的方法是安裝的virtualenv按this即使不幸的是,雖然這兩個他們似乎每個人都說同一個團體寫的開頭。在virtualenv中,獲取源代碼路由,這是pip示例之後的第三個和第四個條目。

全球安裝是

$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz 
$ tar xvfz virtualenv-X.X.tar.gz 
$ cd virtualenv-X.X 
$ [sudo] python setup.py install 

在OSX我通過使用MacPorts安裝了Python和由此PIP從而得到易於安裝,需要複雜的C庫的建立,也使這個引導程序更容易,因爲這已經完蛋了您。

+0

好了,當通過終端,並去'/Libary/Frameworks/Python.framework/Versions/3.3'所以我找到了python3.3所以我如何指定我想使用它的easy_install,這是假設它來用它。我試着在坐在3.3和更深的python3.3下運行easy_install並得到了同樣的結果,那麼是否有特定的方法來指定'this'python? – EasilyBaffled 2013-03-09 20:41:32

+0

virtualenv上的第一個值得注意的地方是如何用pip安裝它,所以我有點困惑,因爲它的目的,第二我不確定你說的最後一行 – EasilyBaffled 2013-03-09 21:22:04

+0

@EasilyBaffled - 是的不是一個非常滿意的頁面 - 我會刪除它。 – Mark 2013-03-09 21:24:31

0

正如您的問題所述,這可能是一個權限問題。嘗試使用sudo進行安裝:

sudo easy_install pip