python下载后无法使用_安装python3之后无法引用_ssl

已安装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'

谁知道这个该怎么处理

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值