2016-12-04 173 views
0

我试图在笔记本电脑上安装Django,但Window PowerShell无法识别该版本。我安装我的笔记本电脑的Python 3.5.2,但我得到的错误:无法安装Django

PS C:\Users\Work> python --version 

python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + python --version + ~~~~~~ + CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

回答

1

这个问题可能是您的操作系统无法识别其中python.exe所在。为了解决这个问题,你应该把python路径添加到系统的变量'path'中。 要做到这一点胜7打开我的计算机的属性>高级系统设置>环境变量>选择'路径'>单击编辑>添加到Python的路径位置。 另一种选择是说Python安装guide运行以下shell:

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User") 

或者你可以改变当前文件夹的地方是使用Windows命令cd安装了Python的文件夹。例如:

cd c:\Python 

之后,python --version应该工作。