【Linux环境部署】Python版本更新及替换

默认python版本替换

1.测试当前默认python版本

user@user-jwq# python
Python 2.7.18 (default, Jul  1 2022, 12:27:04) 
[GCC 9.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

当前默认python版本为2.7.18

2.查看当前环境的python环境

user@user-jwq:/home/faw_vdc# ls -l /usr/bin/python*
lrwxrwxrwx 1 root root       7 Apr 15  2020 /usr/bin/python -> python2
lrwxrwxrwx 1 root root       9 Mar 13  2020 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3662032 Jul  1 12:27 /usr/bin/python2.7
lrwxrwxrwx 1 root root       9 Mar 13  2020 /usr/bin/python3 -> python3.8
-rwxr-xr-x 1 root root 5502744 Jun 22 20:18 /usr/bin/python3.8

3.删除默认python版本

rm /usr/bin/python

4.软链接新的版本

sudo ln -s /usr/bin/python /usr/bin/python3.8

5.安装pip3

sudo apt install python3-pip

6.pip安装程序包

pip install meson

7.pip3更新软件

pip3 install --upgrade <软件名>
pip3 install --upgrade meson

8.pip检查哪些包需要更新

pip list --outdated
posted @ 2022-11-14 22:33  Emma1111  阅读(604)  评论(0编辑  收藏  举报