首页 > 编程语言 > 详细

centos7安装python3

时间:2019-08-12 09:23:27      阅读:69      评论:0      收藏:0      [点我收藏+]

很简单,但是每次安装都要现查,做个记录

cd /tmp
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
yum -y groupinstall "Development tools"
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
mkdir /usr/local/python3 
mv Python-3.6.7.tar.xz /usr/local/python3/
cd /usr/local/python3/
tar xf Python-3.6.7.tar.xz 
cd Python-3.6.7
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

  

验证:

python3
Python 3.6.7 (default, Aug 12 2019, 00:26:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 

  

  

centos7安装python3

原文:https://www.cnblogs.com/Go-Spurs-Go/p/11337435.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!