'pip'不被识别为内部或外部命令 [英] 'pip' is not recognized as an internal or external command

查看:3135
本文介绍了'pip'不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是我输入到我的命令行的顺序:

  C:\Python34> python get-pip.py 
要求已经最新:pip in c: \python34\lib\site-packages
清理...

C:\Python34>点安装Django
'pip'不被识别为内部或外部命令
可操作的程序或批处理文件。

C:\Python34> lib\site-packages\pip安装Django
'lib \site-packages\pip'不被识别为内部或外部命令,
可操作的程序或批处理文件。

可能导致这种情况?



编辑 ___________________



根据要求,这是当我输入echo%PATH%时获得的

  C:\Python34> echo%PATH%
C:\Program Files\ImageMagick-6.8.8-Q16; C:\Program Files x86)\Intel\iCLS Client\
; C:\Program Files\Intel\iCLS Client\; C:\Windows\system32; C:\Windows; C:\\ \\ Windows \S
ystem32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program文件(x86)\
Windows Live \Shared; C:\程序文件(x86)\Intel\OpenCL SDK\2.0\bin\x86; C:\Progr
am文件(x86)\Intel\OpenCL SDK\2.0\bin\x64; C:\Program Files\Intel\Intel(R)Mana
gement Engine Components\DAL; C:\Program Files\Intel\Intel (R)管理引擎C
ompone nts\IPT; C:\Program文件(x86)\Intel\Intel(R)管理引擎组件
\DAL; C:\Program文件(x86)\Intel\Intel( R)管理引擎组件\IPT; C:\P
rogram文件(x86)\\\
odejs\; C:\程序文件(x86)\Heroku\bin; C:\程序文件(x
86)\git\cmd; C:\RailsInstaller\Ruby2.0.0\bin; C:\RailsInstaller\Git\cmd; C:\RailsIn
staller\Ruby1.9.3\bin; C:\Users\Javi\AppData\Roaming\\\
pm


解决方案

您需要将pip安装路径添加到PATH系统变量中。默认情况下,pip安装到 C:\Python34\Scripts\pip (pip现在附带新版本的python),所以路径C:\\ \\ Python34\Scripts需要添加到您的PATH变量中。



要检查它是否已经在您的PATH变量中,请键入 echo%在CMD提示符下的PATH%



要将点阵安装的路径添加到PATH变量,您可以使用控制面板或 setx 命令。例如:

  setx PATH%PATH%; C:\Python34\Scripts






注意
根据< a href =https://technet.microsoft.com/en-us/library/cc755104%28v=ws.11%29.aspx>官方文档,[v]设置setx变量的ariables是仅在将来的命令窗口中可用,不在当前命令窗口中。特别地,在输入上述命令后,您将需要启动一个新的cmd.exe实例,以便使用新的环境变量。



感谢Scott Bartell指出这一点。


I'm running into a weird error trying to install Django on my computer.

This is the sequence that I've typed into my command line:

C:\Python34>python get-pip.py
Requirement already up-to-date: pip in c:\python34\lib\site-packages
Cleaning up...

C:\Python34>pip install Django
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python34>lib\site-packages\pip install Django
'lib\site-packages\pip' is not recognized as an internal or external command,
operable program or batch file. 

What could be causing this?

EDIT ___________________

As requested this is what I get when I type in echo %PATH%

C:\Python34>echo %PATH%
C:\Program Files\ImageMagick-6.8.8-Q16;C:\Program Files (x86)\Intel\iCLS Client\
;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\S
ystem32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\
Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Progr
am Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Mana
gement Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine C
omponents\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components
\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\P
rogram Files (x86)\nodejs\;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x
86)\git\cmd;C:\RailsInstaller\Ruby2.0.0\bin;C:\RailsInstaller\Git\cmd;C:\RailsIn
staller\Ruby1.9.3\bin;C:\Users\Javi\AppData\Roaming\npm

解决方案

You need to add the path of your pip installation to your PATH system variable. By default, pip is installed to C:\Python34\Scripts\pip (pip now comes bundled with new versions of python), so the path "C:\Python34\Scripts" needs to be added to your PATH variable.

To check if it is already in your PATH variable, type echo %PATH% at the CMD prompt

To add the path of your pip installation to your PATH variable, you can use the Control Panel or the setx command. For example:

setx PATH "%PATH%;C:\Python34\Scripts"


Note: According to the official documentation, "[v]ariables set with setx variables are available in future command windows only, not in the current command window". In particular, you will need to start a new cmd.exe instance after entering the above command in order to utilize the new environment variable.

Thanks to Scott Bartell for pointing this out.

这篇关于'pip'不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆