1

I'm trying to install the requests module with pip, but I'm not sure if I'm doing it right. I open up the command prompt on windows(windows key+r,type in 'cmd' and hit enter). I have pip already installed, but when I type in 'pip install requests' to the command prompt it says

    C:\Users\khern>pip install requests
    'pip' is not recognized as an internal or external command,
    operable program or batch file.

When I go check if pip is installed, this comes up

    C:\Users\khern>python -m pip --version
    'python' is not recognized as an internal or external command,
    operable program or batch file.

So, then I go to add python's path to the environment variables changing the top part and the bottom part so hopefully the command prompt can run python programs. But when I go to the command prompt and type python, it still says

    C:\Users\khern>python
    'python' is not recognized as an internal or external command,
    operable program or batch file.

Can someone tell me what I'm doing wrong? I'm new to programming, and just want to install the 'requests' module to finish the class I'm taking on python. Thanks!

Kyle Hernandez
  • 11
  • 1
  • 1
  • 2
  • try `pip3` instead of `pip`. It is not the module, it is the `pip` that is not working. – Aramakus May 29 '20 at 06:37
  • Did you add python to your PATH? – matkv May 29 '20 at 06:38
  • Can you type `python3` into command prompt? I think python will show up. If it does, then you need to add `C:\Python3.7\Scripts\ ` to the environment variables i.e. those parts you show. Then you can use `pip3 install requests` – Mustafa Aydın May 29 '20 at 06:40
  • https://stackoverflow.com/search?q=%5Bpython%5D+is+not+recognized+as+an+internal+or+external+command – phd May 29 '20 at 16:44

2 Answers2

2

visit this link: https://datatofish.com/add-python-to-windows-path/

this will tell you how to add python to a path on windows so that you can access python from anywhere on the system.

if you need to use pip to install request:

python -m pip install requests

but before you run that command you have to make sure you are in pip folder, which generally looks something like this: c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip

Prab
  • 464
  • 3
  • 13
0

The python path I think is not selected. Try reinstalling python and do this: solve python path

or this: solve python path

Check out this link: 'python' is not recognized as an internal or external command

Luca Vlad
  • 95
  • 1
  • 8