未发现Python的命令,但易说,它已经安装:Ubuntu的

问题描述 投票:0回答:2

我在Ubuntu和需要运行一个python脚本,但庆典找不到蟒蛇。

$ python main.py
bash: python: command not found

当我去用apt安装它,有人告诉我,它已经安装。

$ sudo apt-get install python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python is already the newest version (2.7.12-1~16.04).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

我该如何解决?

python ubuntu
2个回答
2
投票

尝试命令which python它,就会发现你的系统已安装Python的位置。

然后尝试将通过which python透露PYTHONPATH作为第一个答案here位置。这是一个很好的地方,明白这一点。


1
投票

它被保存为python3而不是蟒蛇

© www.soinside.com 2019 - 2024. All rights reserved.