zoukankan      html  css  js  c++  java
  • centos7编译安装Python 3.6.8 后用pip3出现SSL未配置问题(import ssl失败)解决方法

    下载源码编译安装openssl

    https://www.openssl.org/source/openssl-1.0.2j.tar.gz

    ./config --prefix=/usr/local/openssl

    ./config -t

    ./make && make install

    下载源码编译安装python3.6.8

    https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz

    修改python3.6.8/Modules/Setup.dist文件

    修改后为:

    204 # Socket module helper for socket(2)
    205 _socket socketmodule.c
    206
    207 # Socket module helper for SSL support; you must comment out the other
    208 # socket line above, and possibly edit the SSL variable:
    209 SSL=/usr/local/ssl
    210 _ssl _ssl.c
    211 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl
    212 -L$(SSL)/lib -lssl -lcrypto
    213

    ./configure --prefix=/usr/bin 

    ./make && make install

  • 相关阅读:
    2020.11.21日记
    Miller-Rabin质数测试
    Deepin配置记录
    shell
    module load
    vma
    DRDI
    Android.mk
    AEE
    阿里云下配置二级域名的解析设置
  • 原文地址:https://www.cnblogs.com/zxpo/p/11078611.html
Copyright © 2011-2022 走看看