我是一个Ubuntu新手,一直在尝试安装Python的easy_install,这样我在安装Python时就不必处理源文件了。
我运行了以下程序,它似乎安装了正确的应用程序:
sudo apt-get install python-setuptools但是,当我运行easy_install sqlalchemy或easy_install pysqlite3时,它不起作用。
我收到以下错误消息:
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-1674.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.帮助!
亚伯拉罕
发布于 2011-03-23 22:26:02
答案很简单,只需运行sudo easy_install。
但是,如果出于某些原因不想这样做,也可以在主目录中安装Python包。这个过程在这篇文章中有详细的描述,包括修改PYTHONPATH环境变量。
https://askubuntu.com/questions/31783
复制相似问题