2010-01-13 106 views
2

我在安装python 2.6.4中的SUDS时遇到了麻烦。我试图安装设置文件,但它说python的位置找不到。这是因为我改变了python的位置。我试图使用easy_install,但没有运气。有谁知道一个简单的方法来做到这一点或有一个链接来清除安装说明。我进入在python 2.6.4中安装SUDS

命令:

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。 cfg在distutils目录中:

[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 
+1

我们需要更多的信息,比如你在哪个平台上,确切的命令尝试,确切的错误报告等。 – 2010-01-13 14:43:10

+0

@gruszczy谢谢,我不知道为什么我没有改变为超级用户。我认为这是造成问题的途径。有点傻,真的,谢谢你的帮助 – chrissygormley 2010-01-13 15:41:28

+0

N/P。记住,如果你使用easy_install,你也需要做一个超级的。快乐黑客与泡沫:-) – gruszczy 2010-01-13 15:47:22

回答

3

您是否尝试过设置PYTHONPATH到python的位置?也许这样它会知道,在哪里安装它。

你叫它python setup.py install。尝试sudo python setup.py install,如果你正在使用一些Linux,你是sudoer。

1

当我安装了suds和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和导入泡沫。关键的一步是将suds site-packages目录放入PYTHONPATH中。

我希望这个帮助来得太晚来帮助原始的海报,但我希望它可以帮助别人谁来到这个问题。就像我那样。

0

我需要您的操作系统的更多细节来给出完全准确的响应。从你的问题的声音,你改变了你的Python的路径。通常情况下,您将拥有与您的操作系统兼容的预安装版本的python。例如,CentOS 5.x自带python 2.4,但是你可以使用python 2.6的yum install。安装完成后,您可以通过python26命令运行python 2.6。

在进行安装和打包时,我会建议您尽可能多地使用软件包管理器,因为它们可以帮助照顾您的依赖关系,例如yum。 Yum还帮助控制更新包,而不是手动更新。接下来最好的事情是通过pipeasy install进行安装,在这个问题的情况下,您可以尝试easy_install https://fedorahosted.org/releases/s/u/suds/python-suds-0.4.tar.gz(需要setuptools),并且作为最后的手段,您可以尝试执行手动安装。如果我明白我正在进行手动安装,我觉得我失败了:) 其他人已经给出了关于如何手动安装的详细信息。

祝你好运。