标签:efi rop www 检验 help 问题 lin mod imp
原地址:https://www.jianshu.com/p/3ec24f563b81
centos安装python3.7时遇到如下问题,查阅知需要的openssl版本最低为1.0.2,但是centos 默认的为1.0.1,所以需要重新更新openssl
import _ssl # if we can‘t import it, let the error propagate ImportError: No module named _ssl
安装依赖库
yum install -y zlib zlib-dev openssl-devel sqlite-devel bzip2-devel libffi libffi-devel gcc gcc-c++
安装openssl
# 注意:openssl编译的时候,需要bzip2库,并且版本要匹配 wget http://www.openssl.org/source/openssl-1.1.1.tar.gz tar -zxvf openssl-1.1.1.tar.gz cd openssl-1.1.1 ./config --prefix=$HOME/openssl shared zlib make && make install
设置环境变量LD_LIBRARY_PATH
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/openssl/lib" >> $HOME/.bash_profile source $HOME/.bash_profile
tar -zxvf Python-3.7.0.tgz ./configure --prefix=$HOME/Py37 --with-openssl=$HOME/openssl make && make install echo $HOME
至此python3.7就安装完了,来检验下ssl模块能否被导入吧:
[root@izbp12am8wqrn7t6wzgmydz Python-3.7.0]# echo $HOME /root [root@izbp12am8wqrn7t6wzgmydz Python-3.7.0]# cd /root/Py37/ [root@izbp12am8wqrn7t6wzgmydz bin]# ./python3 Python 3.7.0 (default, Sep 16 2018, 14:12:43) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> import _ssl >>>
查看源python的路径
whereis python
需要更新软链接
标签:efi rop www 检验 help 问题 lin mod imp
原文地址:https://www.cnblogs.com/wtil/p/12395245.html