在Python 2.6.4安装肥皂水
-
20-09-2019 - |
题
我有在Python 2.6.4安装SUDS真正的麻烦。我试图安装的安装文件,但它说,蟒蛇的位置不能被发现。这是因为我已经改变了蟒蛇的位置。我曾尝试使用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
调用它。尝试sudo python setup.py install
,如果你使用的是一些Linux和你sudoer。
其他提示
当我安装泡沫和python-NTLM我得到这样的消息也。我们的网站有独立的areafor设备,使我们能够保持多个版本,所以我的第一个安装步骤是
python setup.py install --prefix=/install/suds/suds-0.4
和我得到大约installplace相同的消息。要解决:
确认目录是否有以
mkdir -p /install/suds/suds-0.4/lib/python2.6/site-packages/
(这让我感到惊讶了一下,我以为设置将建立目录。)
请确保您有写权限打倒树
chmod -R 775 /install/suds/suds-0.4/lib/python2.6/site-packages/
均未摆脱了消息!
在最后一个步骤是把安装区域分成PYTHONPATH,然后执行setup.py
export PYTHONPATH=/install/suds/suds-0.4/lib/python2.6/site-packages:$PYTHONPATH
python setup.py install --prefix=/opt/sw/fw/qce/suds/suds-0.4
以最终chmod来使新安装的文件可读的情况下umask设置为限制性的东西:
chmod 755 /install/suds/suds-0.4/lib/python2.6/site-packages/*
在这之后我可以开始Python和进口的泡沫。的关键步骤是在把泡沫站点包目录到PYTHONPATH。
我希望这种帮助来得太晚,以帮助原来的海报,但我希望它可以帮助别人谁哪来那么这个问题。正如我一样。
我需要您的操作系统的更多细节给予充分准确的响应。从你的问题的声音,你改变了你的Python的路径。通常情况下,你将有蟒蛇的预装版本与您的操作系统兼容。例如,CentOS的5.x的与Python 2.4,但是你可以做的Python 2.6的yum install
。一旦安装,则可以通过该python26
命令运行python 2.6。
在做安装和包,我建议您尝试使用尽可能多的软件包管理器,因为它们有助于照顾你的依赖,如yum
的。也有助于百胜而不必做手工更新控制更新包。下一个最好的事情是做通过pip
或easy install
安装,在这个问题上的情况下,你可以尝试easy_install https://fedorahosted.org/releases/s/u/suds/python-suds-0.4.tar.gz
(需要setuptools的),并作为最后的手段,你可以尝试做手工安装。我如果我说我正在做一个手工的安装点,我觉得我失败的地方:)
别人给予良好的细节上如何做手工安装。
好运。