已安装openssl模块
rpm -qa|grep openssl
openssl-devel-1.0.1e-42.el6_7.4.x86_64
openssl-1.0.1e-42.el6_7.4.x86_64
并通过源码包手动安装了openssl1.1.1版本
OpenSSL 1.1.1-pre3 (beta) 20 Mar 2018 (Library: OpenSSL 1.1.1a 20 Nov 2018)
安装 python的时候修改了源码包里面的
Modules/Setup.dist
Modules/Setup
这2个文件,解除了下面代码的注释,并将SSL路径制定为新版本openssl的安装路径
_socket socketmodule.c
SSL=/usr/local/openssl
_ssl _ssl.c
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl
-L$(SSL)/lib -lssl -lcrypto
python安装命令
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl --with-ssl-default-suites=python
make
make install
在make的时候,有这么一段信息
*** WARNING: renaming "_dbm" since importing it failed: build/lib.linux-x86_64-3.7/_dbm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: dbm_firstkey
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc _socket _ssl
atexit pwd time
Following modules built successfully but were removed because they could not be imported:
_dbm
python3安装上了,感觉安装是没有问题的,但是在安装模块的时候总提示没有_ssl这个模块
import ssl
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/ssl.py", line 98, in
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
谁知道这个该怎么处理