码迷,mamicode.com
首页 > 编程语言 > 详细

CentOS7下python3.x的源码安装

时间:2020-07-03 17:06:22      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:编译安装   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为例

[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

3、安装相关依赖包

[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

4、开始编译安装

[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

5、建立软链接

[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

6、测试

[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)

 

CentOS7下python3.x的源码安装

标签:编译安装   inux   curses   建立   info   adl   https   copy   span   

原文地址:https://www.cnblogs.com/hovin/p/13231333.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!