我在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.
我该如何解决?
尝试命令which python
它,就会发现你的系统已安装Python的位置。
然后尝试将通过which python
透露PYTHONPATH
作为第一个答案here位置。这是一个很好的地方,明白这一点。
它被保存为python3而不是蟒蛇