Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing requests module in python 2.7 windows

Tags:

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:\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

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

like image 518
misguided Avatar asked Aug 20 '13 22:08

misguided


People also ask

Does Python 2.7 support requests?

Requests officially supports Python 2.7 & 3.4–3.7, and runs great on PyPy.

Does Python 2.7 have pip?

PIP is automatically installed with Python 2.7.9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments. Before you install PIP on Windows, check if PIP is already installed.


1 Answers

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:\Python27\python.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

like image 116
rprez Avatar answered Oct 08 '22 00:10

rprez