Loading... 1、安装各种依赖包 ``` javascript yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel ``` 2、下载python3.7.9安装包并解压缩 ``` javascript wget "https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz" tar -zxvf Python-3.7.9.tgz ``` 3、编译安装 ``` javascript cd Python-3.7.9 ./configure --prefix=/usr/local/python3 make && make install ``` 4、创建软链接 ``` javascript ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 ``` 5、验证 ``` javascript [root@seeker-01 ~]# python Python 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> [root@seeker-01 ~]# python3 Python 3.7.9 (default, Aug 28 2020, 13:28:49) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ``` 最后修改:2021 年 04 月 10 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏
此处评论已关闭