如何将Python添加到PATH?

时间:2019-10-31 21:47:28

标签: python linux path

我有以下

ubuntu@ip:/$ whereis python
python: /usr/bin/python3.7 /usr/bin/python3.7m /usr/bin/python3.6m /usr/bin/python3.6 /usr/lib/python2.7 /usr/lib/python3.7 /usr/lib/python3.6 /etc/python3.7 /etc/python3.6 /usr/local/lib/python3.7 /usr/local/lib/python3.6 /usr/share/python
ubuntu@ip:/$ python --version

Command 'python' not found, but can be installed with:

sudo apt install python3       
sudo apt install python        
sudo apt install python-minimal

You also have python3 installed, you can run 'python3' instead.

如何设置Python,以便可以在终端中调用python,以便其他程序可以使用它?

谢谢

1 个答案:

答案 0 :(得分:0)

您可以将Python3作为默认的python写入bash别名。

请参阅这篇文章:Configure Python 3 as default on Ubuntu