[英]Cannot run Python Script inside VSCODE terminal
我有同样的问题,这个线程帮助我得到一个关于文件“<stdin>”的语法错误,第 1 行
You are now working inside your Python shell (>>>) while the code you are running (& python "FILENAME.py") is no Python, therefore syntax error.
exit()
退出 python shell 并返回 PowerShell 环境。
简单地
python
再次进入,直接运行python代码
您的 PATH 变量中似乎无法识别 python 。 我认为修复的两种方法是找到您的 python 文件路径并将其添加到您的用户变量中:
或者,不确定这是开箱即用的,但您可以:
按照@mah111 的建议编辑 PATH 后,我需要重新启动 VSCODE 应用程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.