ubuntu修改默認python版本

查詢當前默認python路徑
which python
/usr/bin/python

查詢你要修改的python3.7路徑
which python3.7
/usr/bin/python3.7

刪除之前默認的python路徑
sudo rm /usr/bin/python

當前如果你再執行python
bash: /usr/bin/python: No such file or directory

添加默認的路徑
ln -s /usr/bin/python3.7 /usr/bin/python

之後你再運行python,就是python3.7了
python --version
python 3.7.5

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章