20

Windows に要求モジュール (python 2.7) をインストールする際に問題に直面しています。

ドキュメントに従って以下の手順を試しました。

1

pip install requests

エラー

'pip' is not recognized as an internal or external command, operable program or batch file.

2

easy_install requests

エラー

'easy_install' is not recognized as an internal or external command, operable program or batch file.

3

setup.py

エラー

C:\Location\Python\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg)
C:\Location\Python\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'include_package_data' warnings.warn(msg)
C:\Location\Python\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

新しいものをダウンロードせずに、モジュールを windows にインストールする方法を教えてください。

4

4 に答える 4

42

リクエストを直接インストールしたい場合は、Python で利用可能な "-m" (モジュール) オプションを使用できます。

python.exe -m pip install requests

これは PowerShell で直接行うことができますがC:\Python27\python.exepython.exe.

コメントで述べたように、パスに Python を追加した場合は、次のように簡単に実行できます。

python -m pip install requests

于 2016-02-04T00:10:54.740 に答える
6

Windows 10 では、管理者権限で cmd.exe を実行し、次のように入力します。

1) cd \Python27\scripts

2) pip インストール要求

それはうまくいくはずです。私の場合はpython 2.7でした

于 2017-06-23T08:02:46.693 に答える
-7
  1. ソースコード (zip または rar パッケージ) をダウンロードします。
  2. 内部で setup.py を実行します。
于 2014-03-03T03:20:33.327 に答える