我在 python 2.6.4 中安装 SUDS 时遇到了很大的麻烦。我尝试安装安装文件,但它说找不到 python 的位置。这是因为我改变了python的位置。我尝试过使用 easy_install 但没有运气。有谁知道执行此操作的简单方法或有清晰的安装说明的链接。
我输入的命令是:
python setup.py install
我收到的结果是:
running install
error: cannot 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/site-packages/test-easy-install-9203.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.6/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
如果我必须更改 python 路径,你到底该怎么做。
我已经尝试了一个网站所说的操作,首先在 Python 的 site-packages 目录中创建一个 altinstall.pth 文件,其中包含以下行:
import os, site; site.addsitedir(os.path.expanduser('~/lib/python2.3'))
然后它说修改 distutils 目录中的 distutils.cfg :
[install]
install_lib = ~/lib/python2.3
# This next line is optional but often quite useful; it directs EasyInstall
# and the distutils to install scripts in the user's "bin" directory. For
# Mac OS X framework Python builds, you should use /usr/local/bin instead,
# because neither ~/bin nor the default script installation location are on
# the system PATH.
#
install_scripts = ~/bin
最佳答案
您是否尝试过将 PYTHONPATH 设置为 python 的位置?也许这样它就会知道在哪里安装它。
您正在使用python setup.py install
调用它。如果您使用的是 linux 并且您是 sudoer,请尝试 sudo python setup.py install
。
关于python - 在 python 2.6.4 中安装 SUDS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2057380/