Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't install 'pip' for python

I'm going trough the book Learn Python The Hard Way and i need to install pip.(ex46,ex47) So i saved get-pip.py on my computer and in powershell i did :

PS C:\Users\Toto\pip> python Get-pip.py
Downloading/unpacking pip
Installing collected packages: pip
Successfully installed pip
Cleaning up...

but then when i try: PS C:\Users\Toto\pip> pip

i get this error: pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the s pelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pip + ~~~ + CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

C:\Python27\Scripts\ is already on my path.

I can't figure this out. If some one could please help me.

note: i'm on windows 8 and this is with python 2.7

like image 275
Lagastic Avatar asked Dec 18 '14 11:12

Lagastic


People also ask

How do I enable pip in Python?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process.

How do I fix pip not working Python?

A “pip: command not found” error occurs when you fail to properly install the package installer for Python (pip) needed to run Python on your computer. To fix it, you will either need to re-install Python and check the box to add Python to your PATH or install pip on your command line.


1 Answers

Whenever I've installed pip on my Windows machine, it installs to my Python's Scripts folder:

c:\Python34\Scripts

So to get pip to run on the command line, I had to add that path to my PATH environment variable. You can get to those settings by doing the following (assuming Windows 7 or newer):

  1. Right click My Computer and choose Properties
  2. Go to Advanced system settings
  3. Click on the Environment Variables button
  4. Double-click the PATH (or Path) variable listed under System variables
  5. Add c:\Python34\Scripts to the end of the list of other paths making sure that it is separated from the previous entry with a semi-colon

Restart your shell and try running pip. If it still doesn't work, you need to find out where pip got installed. In my Scripts folder, I have a pip.exe file. If you do not, then adding the Scripts folder to your path won't help. You'll have to figure out where it got installed and add that path instead.

like image 129
Mike Driscoll Avatar answered Sep 24 '22 08:09

Mike Driscoll