我似乎可以在VS代码中运行我的Python代码

发布于 2025-02-13 17:25:16 字数 1399 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小镇女孩 2025-02-20 17:25:16

简短答案:

“

最快的解决方案是将VS代码终端从PowerShell切换到CMD。

在下拉下,选择CMD。

长答案:

只需在Powershell中设置路径即可。

打开PowerShell并将其作为管理员运行。
运行此代码:(复制,粘贴从这里)

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Program Files\Python35-32")“

注意:在这里,在路径中,添加您在系统中安装Python的路径,在我的情况下,它是“ C:\ Program Files \ Python35-32”。

它必须解决了错误。

要确认,请运行此代码:

“python --version”

Short Answer:

VS code cmd

Fastest solution is to switch the vs code terminal from Powershell to Cmd.

On the drop-down there choose Cmd.

Long Answer:

Just set the path in the powershell.

Open Powershell and run it as an admin.
Run this code: (copy, paste from here)

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Program Files\Python35-32")“

Note: Here, in Path, add the path where you’ve installed Python in your system, here in my case it is “C:\Program Files\Python35-32”.

It must have resolved the error.

To confirm, run this code:

“python --version”
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文