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

centos7编译安装Python3.6(与2.7并存)

时间:2017-05-30 21:59:29      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:安装   dir   python   tps   pytho   read   org   yum   ble   

首先去官网下载python3.6

https://www.python.org/

环境准备:#yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

mkdir /usr/local/python3

准备安装python

./configure --prefix=/usr/local/python3 --enable-optimizations

make

makeinstall

ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3

ln -s /usr/local/python3/bin/pip /usr/bin/pip3

cd /usr/bin

mv python python.bak

mv python3 python

在etc/profile最后一行中加入变量

export PATH="$PATH:/usr/local/python3/bin"

输入Python

>>>python 3.6

输入pip3 -V 检查是否安装成功

centos7编译安装Python3.6(与2.7并存)

标签:安装   dir   python   tps   pytho   read   org   yum   ble   

原文地址:http://www.cnblogs.com/Sargreis/p/6921379.html

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