Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
799 views
in Technique[技术] by (71.8m points)

installing requests module in python 2.7 windows

I am facing issues while installing request module (python 2.7) on windows.

Tried the below steps as per documentation:

1

pip install requests

error

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

2

easy_install requests

error

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

3

setup.py

error

C:LocationPythonlibdistutilsdist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg)
C:LocationPythonlibdistutilsdist.py:267: UserWarning: Unknown distribution option: 'include_package_data' warnings.warn(msg)
C:LocationPythonlibdistutilsdist.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

Can anyone please advise how to install the module on windows , without downloading any new stuff.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you want to install requests directly you can use the "-m" (module) option available to python.

python.exe -m pip install requests

You can do this directly in PowerShell, though you may need to use the full python path (eg. C:Python27python.exe) instead of just python.exe.

As mentioned in the comments, if you have added Python to your path you can simply do:

python -m pip install requests


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...