我的python没有被识别为cmdlet的名称,当我将旧版本(3.9
)卸载到新版本(3.10
)时,我尝试在环境变量中更新我的路径,但它仍然转到以前的python(3.9)
这是我的路径:
PS D:\CodingFile> & C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/python.exe "d:/CodingFile/Python/Latihan Kuliah/Struktur-Data/amir.py"
& : The term 'C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/python.exe' 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:3
+ & C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/pytho ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:/Users/amirc/...ipts/python.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
根据仍然在旧版本路径上的信息发生错误,任何人都可以帮助..
它表明您正试图从 python3.9 运行它,因为您正试图从 3.9 运行它。在您的命令中:C:/Users/amirc/AppData/Local/Programs/Python/ Python39 /Scripts/python.exe
如果将 python 3.10 添加到 env 变量中,则无需从 wich 文件夹中指定使用 python 命令:
确保在 env 变量中有这两个(请注意,我将斜杠更改为反斜杠\
并在末尾添加了反斜杠):
C:\Users\amirc\AppData\Local\Programs\Python\Python310\
C:\Users\amirc\AppData\Local\Programs\Python\Python310\Scripts\
打开cmd并运行:
python D:\CodingFile\Python\Lecture Exercises\Data-Structures\amir.py
请注意,我将斜杠更改为反斜杠。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句