Windows 10のPCにpython 3.6がインストールされています。私はPycharmを使ってスクリプトを作成しています。私はそこで完璧に走っています。しかし、私の問題は、PowerShellでPythonを実行できないことです。私はpowershellに 'python'と入力するだけで、自動的にpythonを起動するはずです。しかし、私はそれが認識されていないと言っている間違いを得る。Python 3.6がpowershellで認識されない
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\lenovo> python
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
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
いくつかは、これを入力することが示唆:
[Environment]::SetEnvironmentVariable("Path", "$enc:Path;C:\Users\lenovo\AppData\Local\Programs\Python\Python36")
上記のコードで指定されたパスは、私のPCのために正しいです。実際には、私は上記のコードを与えた後、Pythonが実行されます。しかし、それは私の問題です。私がPowerShellを閉じて再び開くたびに、Pythonを実行させるために上記のコードを入力する必要があります。私はPowershellでこれを管理者として実行してみました。しかし、それは動作しません。私もPCを再起動しようとしましたが、問題は解決しません。
新しいPowerShellウィンドウでPythonを実行するたびに、上記のコードを入力すると予想されます。これは少し面倒です。どんな助けもありがとう。ありがとう。
https://stackoverflow.com/questions/714877/setting-windows-powershell-path-variable –
@JohnGordonありがとうございました!しかし、私は答えを理解していない。あなたは簡単な答えを教えていただけますか? ;-) –