‘pip’不被识别为内部或外部命令。

‘pip’不被识别为内部或外部命令。

我在我的电脑上安装Django时遇到了一个奇怪的错误。

这是我在命令行中输入的序列:

C:\Python34>python get-pip.pyRequirement already up-to-date: pip in c:\python34\lib\site-packagesCleaning 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.

是什么导致了这一切?

编辑___________________

根据请求,当我输入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) Management 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 En
gine Components\IPT;C:\P
rogram Files (x86)\nodejs\;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\RailsInstaller\Ruby2.0.0\bin;C:\RailsIns
taller\Git\cmd;C:\RailsIn
staller\Ruby1.9.3\bin;C:\Users\Javi\AppData\Roaming\npm


ITMISS
浏览 2266回答 3
3回答

炎炎设计

您需要将pip安装的路径添加到PATH系统变量中。..默认情况下,pip被安装到C:\Python34\Scripts\pip(PIP现在与python的新版本捆绑在一起),因此需要将路径“C:\Python 34\Script”添加到PATH变量中。若要检查它是否已在PATH变量中,请键入echo %PATH%在CMD提示符下将pip安装的路径添加到PATH变量,您可以使用控制面板或setx命令。例如:setx PATH "%PATH%;C:\Python34\Scripts"注*根据正式文件,“使用SETX变量设置的可变项仅在未来的命令窗口中可用,而不是在当前命令窗口中”。特别是,您需要启动一个新的cmd.exe实例输入上述命令后,才能利用新的环境变量。感谢斯科特·巴特尔指出了这一点。

www说

对于Windows,在安装包时键入:python -m pip install [packagename]
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python