CentOS7下python3.x的源码安装
2021-04-30 01:27
标签:编译安装 inux curses 建立 info adl https copy span 1、下载源码包 下载地址:https://www.python.org/downloads/source/ 或:https://www.python.org/ftp/python/ 2、解压安装包,以python 3.7.8为例 3、安装相关依赖包 4、开始编译安装 5、建立软链接 6、测试 CentOS7下python3.x的源码安装 标签:编译安装 inux curses 建立 info adl https copy span 原文地址:https://www.cnblogs.com/hovin/p/13231333.html一、安装过程
[root@localhost ~]# ll Python-3.7.8.tgz
-rw-r--r-- 1 root root 23276116 Jul 3 16:40 Python-3.7.8.tgz
[root@localhost ~]# tar -zxvf Python-3.7.8.tgz
[root@localhost ~]# 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
[root@localhost ~]# cd Python-3.7.8/
[root@localhost Python-3.7.8]# ./configure --prefix=/usr/local/python3
[root@localhost Python-3.7.8]# make && make install
[root@localhost Python-3.7.8]# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
[root@localhost Python-3.7.8]# ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
[root@localhost Python-3.7.8]# python3
Python 3.7.8 (default, Jul 3 2020, 16:47:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
[root@localhost Python-3.7.8]# pip3 --version
pip 20.1.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)