3

I am attempting to install a module (requests) in python 2.7.4 but am unable to do so because apparently I don't have pip installed? I tried to run "python pip --version" in CMD to check for it and got nothing in return except that pip is not a recognized command.

Have been googling the past 20 minutes and have tried each suggestion to no avail. Sorry for the stupid question but this is quite infuriating.

Xert01998
  • 99
  • 1
  • 5

5 Answers5

2

Python 2.7 must be having pip pre-installed.

Try installing your package by:

Open cmd as admin. (win+x then a)

Go to scripts folder: C:\Python27\Scripts

Type pip install "package name"

Note: Else reinstall python: https://www.python.org/downloads/

Also note: You must be in C:\Python27\Scripts in order to use pip command, Else add it to your path by typing: [Environment]::SetEnvironmentVariable("Path","$env:Path;C:\Python27\;C:\Python27\Scripts\", "User") For New versions

Older versions of python may not have pip installed and get-pip will throw errors. Please update your python (2.7.15 as of Aug 12, 2018).

All current versions have an option to install pip and add it to the path.

Steps:

Open Powershell as admin. (win+x thena')`

Type python -m pip install <package>.

If python is not in PATH, it'll throw an error saying unrecognized cmd. To fix, simply add it to the path as mentioned above.

Bane
  • 334
  • 1
  • 13
1

The new version of python is already contains pip. I feel that you yet not set the environment path. just set environment path and try again.

If the issue still exists you just install pip using typing the following command in CMD

python -m pip install.
Codemaker
  • 4,115
  • 1
  • 32
  • 30
0

According to this answer

Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip.

so perhaps updating to 2.7.9 will solve your problem. Or you could follow some of the other suggestions in that answer to install pip manually.

jq170727
  • 9,278
  • 2
  • 32
  • 50
0

For Ubuntu

sudo apt install python3-pip

or

sudo apt install python-pip
Dorin Brage
  • 139
  • 4
  • 13
0

Try this instead, if you are using windows OS type in command line ".\pip " and whatever command you want to use after, it can be install uninstall etc.