62

Windows XP に Python 2.7 をインストールした後、手動で to を設定%PATH%python.exe(python インストーラーがこれを行わないのはなぜですか?)、次にインストールしsetuptools 0.6c11(python インストーラーがこれを行わないのはなぜですか?)、次に手動で to を設定%PATH%しますeasy_install.exe(なぜ 'しないのですか?)インストーラーはこれを行いますか?)、最終的に で python パッケージをインストールしようとしましたが、依存関係である pywin32 パッケージをインストールできずに失敗しましたeasy_installWindows XP で easy_install を正しく動作させるにはどうすればよいですか? 失敗は次のとおりです。easy_install

C:\>easy_install winpexpect
winpexpect の検索
ベストマッチ: winpexpect 1.4
winpexpect-1.4-py2.7.egg の処理中
winpexpect 1.4 はすでに easy-install.pth のアクティブなバージョンです

c:\python27\lib\site-packages\winpexpect-1.4-py2.7.egg の使用
winpexpect の依存関係の処理
pywin32>=214 を検索しています
http://pypi.python.org/simple/pywin32/ を読む
http://sf.net/projects/pywin32 を読む
http://sourceforge.net/project/showfiles.php?group_id=78018 を読む
pywin32>=214 のローカル パッケージまたはダウンロード リンクが見つかりません
ベストマッチ:なし
トレースバック (最新の呼び出しが最後):
  ファイル「C:\python27\scripts\easy_install-script.py」の 8 行目
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  メインのファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」の 1712 行目
    with_ei_usage(ラムダ:
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、1700 行目、with_ei_usage 内
    f() を返す
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」の 1716 行目
    distclass=DistributionWithoutHelpCommands, **kw
  ファイル「C:\python27\lib\distutils\core.py」、152 行目、セットアップ中
    dist.run_commands()
  ファイル「C:\python27\lib\distutils\dist.py」、953 行目、run_commands
    self.run_command(cmd)
  ファイル「C:\python27\lib\distutils\dist.py」、972 行目、run_command
    cmd_obj.run()
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、211 行目、実行中
    self.easy_install (仕様、self.no_deps ではありません)
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、行 446、easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、481 行目、install_item
    self.process_distribution(spec, dists[0], deps, "使用中")
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、519 行目、process_distribution 内
    【必要条件】、self.local_index、self.easy_install
  ファイル「C:\python27\lib\site-packages\pkg_resources.py」、行 563、解決
    dist = best[req.key] = env.best_match(req、self、installer)
  ファイル「C:\python27\lib\site-packages\pkg_resources.py」、799 行目、best_match
    return self.obtain(req, installer) # 試してダウンロード/インストール
  ファイル「C:\python27\lib\site-packages\pkg_resources.py」、行 811、取得
    返却インストーラー(必須)
  ファイル「C:\python27\lib\site-packages\setuptools\command\easy_install.py」、行 434、easy_install
    self.local_index
  ファイル「C:\python27\lib\site-packages\setuptools\package_index.py」、475 行目、fetch_distribution 内
    dist.clone(location=self.download(dist.location, tmpdir)) を返す
AttributeError: 'NoneType' オブジェクトには属性 'clone' がありません
4

6 に答える 6

22

Windows 7 64 ビット バージョンを使用している場合、解決策は次の場所にあります: http://pypi.python.org/pypi/setuptools

つまり、python スクリプトをダウンロードして実行する必要があります。そうすれば、コマンドラインから easy_install が正常に機能します。

PS私は、これは箱から出してすぐに動作するはずだと言っている元のポスターに同意します.

于 2012-12-06T04:52:49.200 に答える
9

1つの問題は、easy_installが.eggファイルまたはソースディストリビューション(.tgz、.tar、.tar.gz、.tar.bz2、または.zipファイルに含まれる)をダウンロードしてインストールするように設定されていることです。PyWin32拡張機能は別のインストーラー実行可能ファイル内に配置されているため、それらを処理する方法がわかりません。適切なPyWin32インストーラーファイル(Python 2.7用)をダウンロードして、自分で実行する必要があります。easy_installを再度実行すると(Sergioの手順のように正しくインストールされている場合)、winpexpectパッケージが正しくインストールされていることがわかります。

これはWindowsと私たちが話しているオープンソースであるため、適切に機能させるためのインストール方法の厄介な組み合わせになることがよくあります。ただし、easy_installは、構成ファイルを手動で編集するよりも優れています。

于 2010-10-25T16:10:37.807 に答える
8

また、これらすべてが Python で既に設定されている必要があるという OP にも同意します。その日が来るまで、私たちはそれに対処しなければならないと思います。これが実際に私のために働いた解決策です:

easy_install のインストールがより速く簡単に

あなたや同じ問題を抱えている人に役立つことを願っています!

于 2013-08-01T15:09:04.427 に答える
7

以下のスクリプト「ez_setup.py」を以下の URL からコピーします。

https://bootstrap.pypa.io/ez_setup.py

そしてそれをあなたのPythonの場所にコピーします

C:\Python27>

コマンドを実行します

C:\Python27? python ez_setup.py

これにより、スクリプト ディレクトリに easy_install がインストールされます。

C:\Python27\スクリプト

Scripts ディレクトリから簡単なインストールを実行 >

C:\Python27\Scripts> easy_install

于 2014-11-21T09:02:15.983 に答える
1

1 つには、既にそのモジュールがインストールされていると表示されます。アップグレードする必要がある場合は、次のようにする必要があります。

easy_install -U パッケージ名

もちろん、パッケージにコンパイルが必要な C ヘッダーが含まれていて、適切なバージョンの Visual Studio がインストールされていない場合、easy_install はうまく機能しません。easy_install の代わりに pip または distributed を使用してみて、それらがうまく機能するかどうかを確認してください。

于 2010-10-25T15:44:25.123 に答える