linux中python安装ssl模块

安装openssl

下载地址https://pan.baidu.com/s/1s-50hp_HIXBtjPz7vFvBCQ

yum install openssl-1.0.0-27.el6.x86_64.rpm

安装openssl-devel

下载地址https://pan.baidu.com/s/1JAbnyPLNbPxnwwnnQaiy4A

yum install  openssl-devel-1.0.0-27.el6.x86_64.rpm

查看安装是否成功

rpm -qa|grep ssl

 

 

查看python的版本

#python  -V  
Python 2.6.6

 

1.下载Python-2.7.15
#wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz

2.解压
#tar -jxvf Python-2.7.15.tgz

3.更改工作目录
#cd Python-2.7.15

修改python的Setup文件
vi /usr/software/Python-2.7.15/Modules/Setup
#修改结果如下:
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# 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

4.安装
#./configure
#make all           
#make install
#make clean
#make distclean

5.查看版本信息
#/usr/local/bin/python2.7 -V

6.建立软连接,使系统默认的 python指向 python2.7
#mv /usr/bin/python /usr/bin/python2.6.6
#ln -s /usr/local/bin/python2.7 /usr/bin/python

7.重新检验Python 版本
#python -V

8解决系统 Python 软链接指向 Python2.7 版本后,因为yum是不兼容 Python 2.7的,所以yum不能正常工作,我们需要指定 yum 的Python版本
#vi /usr/bin/yum


将文件头部的
#!/usr/bin/python

改成
#!/usr/bin/python2.6.6


http://www.zhangchun.org/the-centos6-3-upgrade-python-to-2-7-3-

这篇教程就到这里了,但是不久就突然发现输入法图标不见了,然后打字没有候选框!iBus 崩了!再次进行搜索,又是版本问题 iBus也是不支持Python2.7的啊!

于是。。。

9.配置iBus

分别用 vi 打开下面两个文件,找到 exec python 那一行,把exec python 改为 exec python2.6 保存,退出。iBus在重启后就恢复正常了!是不是很开心?

#vi /usr/bin/ibus-setup
#vi/usr/libexec/ibus-ui-gtk

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值