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