【发布时间】:2020-10-26 19:11:15
【问题描述】:
我最近在 Ubuntu 上安装了 Sublime text。当我尝试运行一些python代码时,弹出以下错误:
bash: python: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: python -u "/home/user/Desktop/Python Project/test.py"]
[dir: /home/user/Desktop/Python Project]
[path: /home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]
当我跑步时
python 在命令行上,我得到:
command 'python3' from deb python3
command 'python' from deb python-is-python3
当我跑步时
python3
在命令行上,我得到:
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
【问题讨论】:
-
你的电脑上安装了python本身吗?
-
如果进入命令行,
which python3返回什么? -
这些是构建说明,不是错误。请包括错误本身。
-
@JohnGordon 是的,我已经在我的电脑上安装了 python。
-
有没有办法可以将 Sublime Text 配置为使用
python3作为命令而不是python?
标签: python python-3.x bash python-2.7 sublimetext3