2016-12-04 169 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應該工作。