zoukankan      html  css  js  c++  java
  • Python3.6 提示 ModuleNotFoundError: No module named '_ssl' 模块问题

    Centos 6

    python3.6.0 提示 ModuleNotFoundError: No module named '_ssl' 模块问题 ;

    检测 系统 安装 OpenSSL

    国内 163 yum 源挺好用 (中科大的也不错)
    http://mirrors.163.com/.help/CentOS6-Base-163.repo
    
    yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ openssl-devel

    然后 重新编译 python

    编辑 取消注释 以下几行:
    ~ python/Modules/Setup.dist
    大约在 209209 SSL=/usr/local/ssl
    210 _ssl _ssl.c 
    211 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl 
    212 -L$(SSL)/lib -lssl -lcrypto

    重新编译 

    ./configure --prefix=/usr/local/python
    make
    make install

    python3.6.0

    Python 3.6.0 (default, Nov 30 2018, 15:04:54) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ssl
    >>> 
    Use quit() or Ctrl-D (i.e. EOF) to exit

    import ssl 没有提示,验证正常。

  • 相关阅读:
    开开心心
    HOW HE/SHE'S SEEN
    天池
    sql server deadlock跟踪的四种方法
    reduce 好东西
    object方法
    页面横向滚动 联动 进度条
    浅拷贝、深拷贝
    图片下载
    axios简单封装
  • 原文地址:https://www.cnblogs.com/sharesdk/p/10070988.html
Copyright © 2011-2022 走看看