我无法为python安装“ pip”

Lagastic

我正在阅读《学习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...

但是当我尝试时: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

迈克·德里斯科尔

只要在Windows计算机上安装了pip,它就会安装到Python的Scripts文件夹中:

c:\Python34\Scripts

因此,要使pip在命令行上运行,我必须将该路径添加到PATH环境变量中。您可以通过执行以下操作来获得这些设置(假设使用Windows 7或更高版本):

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

重新启动您的Shell并尝试运行pip。如果仍然无法正常工作,则需要找出pip的安装位置。在我的脚本文件夹中,我有一个pip.exe文件。如果不这样做,则将Scripts文件夹添加到您的路径不会有帮助。您必须弄清楚它的安装位置,然后添加该路径。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章