首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行程序时VScode扩展代码运行程序不工作/错误(python)

运行程序时VScode扩展代码运行程序不工作/错误(python)
EN

Stack Overflow用户
提问于 2022-05-08 15:22:51
回答 2查看 889关注 0票数 0

当我安装代码运行程序扩展而无法运行python程序时,会弹出以下错误:

代码语言:javascript
复制
Copyright © Microsoft Corporation. All rights reserved. 
Try the new cross-platform PowerShell https://aka.ms/pscore6 
Warning: PowerShell detected that you might be using a screen-reader and has disabled PSReadLine for compatibility purposes. 
If you want to re-enable it, run 'Import - Module PSReadLine'. 
PS C:\Users\Admin\OneDrive\Máy tính\py projects python -u " C\Users\ Admin\OneDrive\Máy tính\py project\test.py " 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 -u " C:\Users\Admin\OneDrive\Máy tính\py project\test.py "  ' ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotException
+ FullyQualifiedErrorId : CommandNotFoundException

当我关闭扩展时,代码将正常运行,但当我打开错误时会弹出。谢谢你阅读我的问题!(·https://i.stack.imgur.com/62MI3.png·̀ω·́)✧1:

EN

Stack Overflow用户

回答已采纳

发布于 2022-05-09 02:34:02

什么意思“关闭延长其工作正常”。根据错误报告,这应该是Python环境变量设置的一个问题。您试过名为“运行Python文件”的方式吗?这是延伸塔的一个功能。

顺便说一下,您应该已经安装了python扩展。

更新:

您可以使用此选项运行python文件。这是Microsoft正式提供的文件运行选项。

票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72162456

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档