【发布时间】:2014-02-02 12:28:50
【问题描述】:
我是一个相对较新的 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 看看是否有任何效果,但没有。
标签: python-2.7 pip packages easy-install