我是一個相對較新的python用戶,我一直在遇到這個(也許很簡單?)的問題,它真的阻礙了我的進步。安裝和導入python軟件包
這是問題所在。無論何時我嘗試使用pip或easy_install安裝軟件包,都會收到錯誤消息,指出我的用戶配置文件無法訪問安裝目錄。不過,我是我電腦的管理員。安裝永遠不會完成使用easy_install(我得到下面的錯誤),但它最終完成使用pip,但我不能導入安裝後的軟件包 - 我得到了通常的「沒有模塊命名[模塊名稱]」錯誤。
Easy_install error message:
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: '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/test-easy-install-3280.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Frameworks/Python.framework/Versions/7.3/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://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
看起來我的站點包文件夾在python 2.7文件夾中是空的。這是安裝的軟件包應該在哪裏?我試着將模塊的文件夾移動到這個位置,重新啓動python以查看是否有任何效果,但沒有任何效果。 – user2179795