我試圖使用easy_install
做無法使用easy_install的安裝Python模塊
easy_install requests
安裝一個名爲請求模塊這一個星期前,工作得很好,當我使用Python 2.6.5,但今天我安裝了Python 2.7.2,然後在我的腳本的人試圖import requests
但失敗了。然後我嘗試重新安裝與easy_install requests
請求,但得到這個錯誤
install_dir /usr/local/lib/python2.6/dist-packages/
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.6/dist-packages/test-easy-install-15207.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.6/dist-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://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
所以我被告知去重新安裝的easy_install和我去http://pypi.python.org/pypi/setuptools和教訓,我不得不
刪除所有的setuptools * .egg和setuptools的從 系統的站點包目錄(以及任何其他的sys.path目錄) FIRST .pth文件。
所以我這樣做。然後我重新安裝了setuptools-0.6c11-py2.7.egg
的setuptools。這似乎成功,但,當我跑easy_install requests
我得到了基本相同的錯誤除了目錄python2.6的/ DIST-包現在python2.7/site-packages中
[email protected]:~$ easy_install requests
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/test-easy-install-16253.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.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.
此外,當我做easy_install
和壓片我得到這些選項
easy_install easy_install-2.6 easy_install-2.7
easy_install-2.6在那裏?
和
我如何易於安裝工作了?
是我沒有'須藤的easy_install requests'但也不能工作。問題是,看起來我的Python路徑有些問題。 easy_install或Python 2.7.2正在尋找我認爲錯誤的路徑。像Python 2.7.2一樣在python2.6/dist-packages目錄中查找。不確定。 – Classer
我也在瀏覽這個,沒有'sudo'或者我只是用它。 – Amanda