Centos 6python
python3.6.0 提示 ModuleNotFoundError: No module named '_ssl' 模块问题 ;linux
检测 系统 安装 OpenSSLc++
国内 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
而后 从新编译 pythonsql
编辑 取消注释 如下几行: ~ python/Modules/Setup.dist 大约在 209 行 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
从新编译 ui
./configure --prefix=/usr/local/python make make install
python3.6.0spa
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 没有提示,验证正常。code