Answer a question

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

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.

Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐