修改python默認(rèn)版本

ubuntu@ubuntu:~/work/tool/Python-3.8.8$ python --version

Python 2.7.12

顯示的是ubuntu自帶版本

ubuntu@ubuntu:~/work/tool/Python-3.8.8$ python3 --version

Python 3.8.8

要改一下

ubuntu@ubuntu:~/work/tool$ which python3

/usr/local/bin/python3

ubuntu@ubuntu:~/work/tool$ update-alternatives --list python

update-alternatives: error: no alternatives for python

#說明沒有配這個(gè)python

ubuntu@ubuntu:~/work/tool$ sudo update-alternatives --install /usr/bin/python python /usr/local/bin/p

pip3 ?????????????pydoc3 ???????????python3 ??????????python3.8-config

pip3.8 ???????????pydoc3.8 ?????????python3.8 ????????python3-config

ubuntu@ubuntu:~/work/tool$ sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.8 1

update-alternatives: using /usr/local/bin/python3.8 to provide /usr/bin/python (python) in auto mode

ubuntu@ubuntu:~/work/tool$ python --version

Python 3.8.8

給自己留點(diǎn)腳印防止以后參考網(wǎng)站掛掉,附參考網(wǎng)址

https://blog.csdn.net/jc15988821760/article/details/95166733

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容