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

安装配置python3.5

时间:2016-06-03 15:58:58      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:文件夹   源代码   python   

安装openssl与openssl-devel包
yum -y install openssl openssl-devel


到官网下载Python3的最新版
https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

解压Python安装包(我默认放在/root下)
cd /root
tar xzvf Python-3.5.1.tgz



进入python源代码文件夹,进入Modules文件夹,修改Setup.dist,使其支持发送https请求。
cd /root/Python-3.5.1/Modules
vim Setup.dist

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
#_ssl _ssl.c \
#        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
#        -L$(SSL)/lib -lssl -lcrypto
修改为
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto



编译安装,设置安装目录为/usr/local/python-3.5,以免与系统已安装的python2冲突。
./configure --prefix=/usr/local/python-3.5
make
make install


本文出自 “jiazheming” 博客,请务必保留此出处http://8888866666.blog.51cto.com/6988153/1785699

安装配置python3.5

标签:文件夹   源代码   python   

原文地址:http://8888866666.blog.51cto.com/6988153/1785699

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