Python 未被识别为 cmdlet 的名称

阿米尔·卡亚迪

我的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 命令:

  1. 确保在 env 变量中有这两个(请注意,我将斜杠更改为反斜杠\并在末尾添加了反斜杠):

    C:\Users\amirc\AppData\Local\Programs\Python\Python310\

    C:\Users\amirc\AppData\Local\Programs\Python\Python310\Scripts\

  2. 打开cmd并运行:

    python D:\CodingFile\Python\Lecture Exercises\Data-Structures\amir.py

请注意,我将斜杠更改为反斜杠。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

“nx”未被识别为 cmdlet 的名称

常量未被识别为cmdlet的名称

术语“”未被识别为cmdlet的名称

术语“conda”未被识别为 cmdlet 的名称

python3:术语“ python3”未被识别为cmdlet的名称

Python uvicorn:术语“ uvicorn”未被识别为cmdlet,函数,脚本文件的名称

术语“ Set-AzureKeyVaultKeyAttributes”未被识别为cmdlet的名称,

术语“安装模块”未被识别为cmdlet的名称

Gulp-术语“ gulp”未被识别为cmdlet的名称

术语“ get-splogevent”未被识别为cmdlet的名称

术语“remove-distributiongroupmember”未被识别为 cmdlet 的名称

术语“Win32_computerSystem”未被识别为 cmdlet 的名称

为什么 System.AccessToken 未被识别为 Azure DevOps 发布中的 cmdlet 名称?

New-ScheduledTaskAction:术语“ New-ScheduledTaskAction”未被识别为cmdlet的名称

Install-Module:术语“ Install-Module”未被识别为cmdlet的名称

Get-AzureRmResourceGroup:术语“ Get-AzureRmResourceGroup”未被识别为cmdlet的名称

ng:术语“ ng”未被识别为cmdlet的名称,功能Visual Studio Code Terminal

通过 c# 执行 powershell 脚本会抛出“<comment> 未被识别为 cmdlet 的名称”异常

React serve -s build,术语“ serve”未被识别为cmdlet的名称

wslpath :命令 vscode 中的术语“wslpath”未被识别为 cmdlet 的名称

Login-AzureRmAccount:术语“ Login-AzureRmAccount”未被识别为cmdlet,函数,脚本的名称

术语“ az”未被识别为cmdlet,函数,脚本文件或可运行程序的名称

Azure自动化Powersell Runbook失败:“ Invoke-Sqlcmd”未被识别为cmdlet的名称

dotnet无法识别为cmdlet的名称

无法将ItemPropertyValue识别为cmdlet的名称

术语“New-AzureRmServiceBusNamespace”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称

术语 'OC_EDITOR="subl" 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称

'[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ;\UpdateView.exe' 未被识别为 cmdlet 的名称

go:术语“ go”未被识别为cmdlet,函数,脚本文件或可运行程序的名称