gpt4 book ai didi

python - 为什么我的代码无法在 Visual Studio Code 中运行?

转载 作者:行者123 更新时间:2023-12-01 00:48:57 26 4
gpt4 key购买 nike

我无法在 Visual Studio Code 中运行我的代码。当我输入 $ code hello.py 时会发生这种情况:

Enter image description here

最佳答案

在图像中,您使用了代码 hello.py。您应该使用python hello.py。仅当安装 Python 软件时选中“将 Python 添加到路径”时,才可以在命令提示符下运行。

如果您使用的是 Mac

在 Mac 中,Python 2.7 会自动安装。如果您想使用 Python 3,则必须从 Python 官方网站手动安装并使用 python3 hello.py 才能使用 Python 3。

关于python - 为什么我的代码无法在 Visual Studio Code 中运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56720780/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com