我不能为python安装'pip'

Lag*_*tic 12 python windows powershell pip python-2.7

我将通过"学习Python困难之路"这本书,我需要安装pip.(ex46,ex47)所以我在我的计算机上保存了get-pip.py,并在powershell中保存了:

PS C:\Users\Toto\pip> python Get-pip.py
Downloading/unpacking pip
Installing collected packages: pip
Successfully installed pip
Cleaning up...
Run Code Online (Sandbox Code Playgroud)

但是当我尝试时:PS C:\ Users\Toto\pip> pip

我收到此错误: 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 \已经在我的路径上了.

我无法弄清楚这一点.如果有人能帮助我.

注意:我在Windows 8上,这是用python 2.7

Mik*_*oll 12

每当我在我的Windows机器上安装pip时,它都会安装到我的Python的Scripts文件夹中:

c:\Python34\Scripts
Run Code Online (Sandbox Code Playgroud)

所以为了让pip在命令行上运行,我必须将该路径添加到我的PATH环境变量中.您可以通过执行以下操作来实现这些设置(假设Windows 7或更高版本):

  1. 右键单击我的电脑,然后选择 Properties
  2. 转到高级系统设置
  3. 单击Environment Variables按钮
  4. 双击下面列出的PATH(或Path)变量 System variables
  5. 添加c:\Python34\Scripts到其他路径列表的末尾,确保使用分号将其与上一个条目分开

重新启动shell并尝试运行pip.如果它仍然不起作用,您需要找出pip安装的位置.在我的Scripts文件夹中,我有一个pip.exe文件.如果不这样做,那么将Scripts文件夹添加到您的路径将无济于事.您必须弄清楚它的安装位置并改为添加该路径.