为什么在VSCODE中运行Python代码时我无法接收输出?

发布于 2025-02-03 02:36:09 字数 266 浏览 1 评论 0原文

我试图打印简单的消息,例如“ Hello World!”但总是会遇到:[运行] python -u“/users/user/helloworld !!/app.py” /bin/sh:python:找不到命令

[完成]用代码= 127在0.176秒内退出 在此处输入图像描述

是否有任何方法可以通过此错误?

I have tried to print simple messages like "Hello World!" but have always been met with: [Running] python -u "/Users/user/HelloWorld!!/app.py"
/bin/sh: python: command not found

[Done] exited with code=127 in 0.176 seconds
enter image description here

Is there any way to get passed this error?

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

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

发布评论

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

评论(1

也只是曾经 2025-02-10 02:36:09

检查环境变量路径

每次您作为用户在控制台上运行命令时,机器在环境变量路径中存储的预定义目录的列表中寻找其位置或地址。

这种设计有助于正确运行程序或命令,而无需指定终端上的绝对路径。

环境变量路径可以在当前终端会话中暂时修改,也可以永久修改。

for Windows/mac/linux

,并

转到VS Code offecters ofference ofference ofference LL查找解释器路径,因此将其设置为Python安装,重新启动VS代码的路径,您应该很好。

Check environment variable PATH

Every time you as a user run a command on your console, the machine looks for its location, or address, inside a list of predefined directories that are stored inside the environment variable PATH.

Such design helps to properly run the program or command without having to specify the absolute path on the terminal.

The environment variable PATH can be modified temporarily for the current terminal session, or permanently.

For windows/mac/linux

AND

Go to the VS Code preferences, and under interpreter, you'll find Interpreter Path, so set that to the path of your python installation, restart VS Code, and you should be good.

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