Pip install - Python 2.7 - Windows 7
Asked Answered
M

8

19

I download the get-pip.py from https://pip.pypa.io/en/stable/installing/ . Then i changed path in: system-variable environment into : C:\Python27\ArcGIS10.3\Lib\site-packages after that i tried to run in from the cmd and this is the result:

enter image description here

Mccain answered 29/2, 2016 at 12:51 Comment(0)
S
29

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:

  1. Open Powershell as admin. (win+x then a)
  2. 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 below[1].

[OLD Answer]

Python 2.7 must be having pip pre-installed.

Try installing your package by:

  1. Open cmd as admin. (win+x then a)
  2. Go to scripts folder: C:\Python27\Scripts
  3. Type pip install "package name" .

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

[1] 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")

Series answered 29/2, 2016 at 15:47 Comment(2)
I think Python 2.7.1 does not come with pip. No such file/dir in the Scripts subfolder.Kisangani
my Python 2.7.8 does not have pip by default.Affectionate
A
8

Download pip script from https://bootstrap.pypa.io/get-pip.py and then run using python as:-

python get-pip.py

or you can use python to install modules directly

python -m pip install <module>
Adamantine answered 22/5, 2018 at 14:7 Comment(1)
bootstrap.pypa.io/pip/2.7/get-pip.pyAugend
I
5

It is possible that in python 2.7 pip is installed by default. if it is not then you can execute

python -m ensurepip --default-pip

This worked for me.

Source: https://docs.python.org/2/installing/

Imprecate answered 26/2, 2018 at 16:39 Comment(2)
"ensurepip is disabled in Debian/Ubuntu for the system python" :/Einhorn
doesnt work: :\Python27\python.exe: No module named ensurepipArkansas
A
4

This is one way of installing pip on a Windows system.

  1. Download the "get-pip" python script from here: https://bootstrap.pypa.io/get-pip.py

  2. Save the file as getpip.py

  3. Run it from cmd: python getpip.py install

Antheridium answered 29/2, 2016 at 12:54 Comment(1)
still i get the same result :-( what should i do?Mccain
J
4

I've seen this issue before with 2.7.14. Fixed it by :

  1. Re-install python 2.7.14
  2. During the installation, select default path and put a check mark in the installation options to add python to windows path i.e. environmental variables.
  3. After installation is complete, go to System from the Control Panel, select Advanced system settings, and clicking Environment Variables.
  4. Verify that the system variable "path" has "C:\Python\;C:\Python\Scripts;" added to the list.
  5. In cmd, run "where python" and then "where pip". Which will show for example:

    λ where python
    C:\Python\python.exe
    
    λ where pip
    C:\Python\Scripts\pip.exe
    
  6. Run pip, then it should show different pip run command options.

Jesus answered 22/2, 2018 at 14:36 Comment(0)
L
1

Add the following to you environment variable PATH.

C:\Python27\Scripts

This path will contain the pip executable file. Make sure it exist. If it doesn't then you'll need to install it using the get-pip.py script.

Additonally, you can read the following link to get a better understanding.

Lectern answered 29/2, 2016 at 15:56 Comment(0)
S
0

pip is installed by default when we install Python in windows. After setting up the environment variables path for python executables, we can run python interpreter from the command line on windows CMD After that, we can directly use the python command with pip option to install further packages as following:-

C:\ python -m pip install python_module_name

This will install the module using pip.

Sil answered 10/9, 2017 at 12:11 Comment(0)
I
0

you have to first download the get-pip.py and then run the command :

python get-pip.py

Impellent answered 9/2, 2018 at 8:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.