2

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 パスを変更する必要がある場合は、どのように正確にこれを行うのですか?

あるサイトが言ったことを試してみましたが、最初に、次の行を含む altinstall.pth ファイルを Python の site-packages ディレクトリに作成しました。

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
4

3 に答える 3

3

PYTHONPATH を python の場所に設定してみましたか? たぶん、この方法で、どこにインストールするかがわかります。

で呼び出していpython setup.py installます。sudo python setup.py installLinux を使用していて、sudoer を使用している場合は、 を試してください。

于 2010-01-13T14:43:52.550 に答える
1

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に配置してから、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

umaskが制限的なものに設定されている場合に、新しくインストールされたファイルを読み取り可能にするための最後のchmodを使用します。

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

この後、Pythonを起動してsudをインポートできます。重要なステップは、sudssite-packagesディレクトリをPYTHONPATHに配置することでした。

この助けが元のポスターを助けるには遅すぎると思いますが、この質問でSOに来る他の誰かに役立つことを願っています。私がしたように。

于 2011-11-09T05:12:20.423 に答える
0

完全に正確な回答を得るには、OS の詳細が必要です。あなたの質問の音から、あなたはpythonのパスを変更しました。通常、OS と互換性のあるバージョンの Python がプリインストールされています。たとえば、CentOS 5.x には python 2.4 が付属していますがyum install、python 2.6 を実行できます。インストールが完了すると、コマンドで python 2.6 を実行できますpython26

インストールとパッケージを行うときは、できるだけパッケージ マネージャーを使用することをお勧めしますyum。. Yum は、更新を手動で行う代わりに、パッケージの更新を制御するのにも役立ちます。次善の策は、pipまたはを介し​​てインストールを行うことeasy installです。この質問の場合は、試すことができeasy_install https://fedorahosted.org/releases/s/u/suds/python-suds-0.4.tar.gz(setuptools が必要です)、最後の手段として、手動インストールを試みることができます。私が手動インストールを行っていることを理解したら、どこかで失敗したと感じます:) 手動でインストールを行う方法については、他の人が詳細に説明しています。

幸運を。

于 2015-04-27T21:04:59.120 に答える