在 python 2.6.4 中安装 SUDS

发布于 2024-08-17 08:26:45 字数 1882 浏览 4 评论 0原文

我在 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

I am having real trouble installing SUDS in python 2.6.4. I have tried to install the setup file but it says the location of python cannot be found. This is because I have changed the location of python. I have tried to use easy_install but am having no luck. Does anyone know a simple way to do this or have a link to clear installation instructions.

Command that I entered was:

python setup.py install

The result I recieved was:

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

And if I have to change the python path how exactly do you do this.

I have tried what one site said to do and it was to first, create an altinstall.pth file in Python's site-packages directory, containing the following line:

import os, site; site.addsitedir(os.path.expanduser('~/lib/python2.3'))

Then it says modify distutils.cfg in the distutils directory with:

[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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沦落红尘 2024-08-24 08:26:45

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

您正在使用python setup.py install调用它。如果您使用的是 linux 并且您是 sudoer,请尝试 sudo python setup.py install 。

Have you tried setting PYTHONPATH to the location of python? Maybe this way it will know, where to install it.

You are calling it with python setup.py install. Try sudo python setup.py install, if you are using some linux and you are sudoer.

笑忘罢 2024-08-24 08:26:45

当我安装 suds 和 python-ntlm 时,我也收到了这样的消息。我们的网站有一个单独的安装区域,以便我们可以维护多个版本,所以我的第一个安装步骤是,

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,然后使用

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 执行 setup.py,以使新安装的文件可读,以防 umask 设置为限制性的:

 chmod 755 /install/suds/suds-0.4/lib/python2.6/site-packages/*

此后我可以启动 python 并导入 suds。关键步骤是将 suds site-packages 目录放入 PYTHONPATH。

我希望这个帮助来得太晚,无法帮助原始发帖人,但我希望它可以帮助其他提出这个问题的人。正如我所做的那样。

I got messages like this too when I installed suds and python-ntlm. Our site has a separate areafor installations so that we can maintain multiple versions, so my first installation step was

python setup.py install --prefix=/install/suds/suds-0.4

and I got the same messages about installplace. To fix:

Make sure the directories are there with

mkdir -p  /install/suds/suds-0.4/lib/python2.6/site-packages/

(This surprised me a little, I thought setup would build the directories.)

Make sure you have write permission down the tree with

chmod -R 775 /install/suds/suds-0.4/lib/python2.6/site-packages/

Neither of which got rid of the message!

The last step was to put the install area into PYTHONPATH, and then do the 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

with a final chmod to make the newly installed files readable in case umask is set to something restrictive:

 chmod 755 /install/suds/suds-0.4/lib/python2.6/site-packages/*

After this I could start python and import suds. The key step was the putting the suds site-packages directory into PYTHONPATH.

I expect this help comes too late to help the original poster, but I hope it helps someone else who come to SO with this question. As I did.

纵情客 2024-08-24 08:26:45

我需要有关您操作系统的更多详细信息才能给出完全准确的答复。从你的问题的声音来看,你改变了你的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),作为最后的手段,您可以尝试手动安装。如果我明白我正在进行手动安装,我觉得我在某个地方失败了:)
其他人已经详细介绍了如何手动进行安装。

祝你好运。

I would need more details of your OS to give a fully accurate response. From the sounds of your question, you changed your path of python. Normally you'll have a preinstalled version of python that is compatible with your OS. For example, CentOS 5.x comes with python 2.4, however you can do a yum install of python 2.6. Once installed, you can run python 2.6 by the python26 command.

When doing installs and packages, I would recommend that you try to use package managers as much as possible, as they help take care of your dependencies, such as yum. Yum also helps control updating packages instead of having to do updates manually. The next best thing is to do installs via pip or easy install, in the case of this question, you can try easy_install https://fedorahosted.org/releases/s/u/suds/python-suds-0.4.tar.gz (requires setuptools), and as a last resort, you can try to do the manual install. I if I get the point that I'm doing a manual install, I feel I failed somewhere :)
Others have given good detail on on how to do the install manually.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文