命令:
python
提示:
bash: python: command not found
使用whereis指令,获取python3的路径
whereis python3
提示:
python3: /usr/bin/python3.8-config /usr/bin/python3 /usr/bin/python3.8 /usr/lib/python3 /usr/lib/python3.9 /usr/lib/python3.8 /etc/python3 /etc/python3.8 /usr/local/lib/python3.8 /usr/include/python3.8 /usr/share/python3
如果没有vim命令 就执行下面命令 或者换成vi
apt-get update
apt-get install vim
编辑.bashrc文件
vim ~/.bashrc
在如图下添加:
alias python='/usr/bin/python3'
source ~/.bashrc
python
到这里就好啦!