码迷,mamicode.com
首页 > 其他好文 > 详细

安装openssl-1.1.1

时间:2020-06-10 18:58:10      阅读:348      评论:0      收藏:0      [点我收藏+]

标签:direct   rpm   腾讯   director   echo   prefix   openssl安装   情况   init   

1.前因

  python 导入clickhouse_driver需要import ssl和_ssl,报错  

  File "/home/oracle/python3/lib/python3.7/site-packages/clickhouse_driver-0.1.2-py3.7-linux-x86_64.egg/clickhouse_driver/__init__.py", line 2, in <module>
    from .client import Client
  File "/home/oracle/python3/lib/python3.7/site-packages/clickhouse_driver-0.1.2-py3.7-linux-x86_64.egg/clickhouse_driver/client.py", line 1, in <module>
    import ssl
  File "/home/oracle/python3/lib/python3.7/ssl.py", line 98, in <module>
    import _ssl             # if we cant import it, let the error propagate
ImportError: libssl.so.1.1: cannot open shared object file: No such file or director 

  查看openssl安装情况  

[root@localhost ~]# rpm -aq|grep openssl
openssl-1.0.1e-58.el6_10.x86_64
openssl-devel-1.0.1e-58.el6_10.x86_64

  版本是1.0.1e,不符合需求

2.下载openssl

  从 openssl官网下载最新的代码包,因为源站下载速度过慢,所以我使用了腾讯云的镜像

#从官网下载
# wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz

#腾讯云提供的镜像
wget https://mirrors.cloud.tencent.com/openssl/source/openssl-1.1.1g.tar.gz

3. 编译 openssl

tar -xvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g
./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl
make && make install

4.配置

echo "/usr/local/openssl/lib/" >> /etc/ld.so.conf
ldconfig

5.测试

[oracle@localhost ~]$ python3
Python 3.7.2rc1 (default, Nov  1 2019, 08:59:21) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> 

  成功!

  

安装openssl-1.1.1

标签:direct   rpm   腾讯   director   echo   prefix   openssl安装   情况   init   

原文地址:https://www.cnblogs.com/ycy1518/p/13087193.html

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