ImportError: DLL load failed while importing _ssl: 找不到指定的模块。conda 环境报错 【问题解决】
conda 环境运行 命令报错
PS C:\Users\山河已无恙\Documents\GitHub\mtcnn_demo> & C:/Users/liruilong/AppData/Local/conda/conda/envs/mtcnn/python.exe c:/Users/山河已无恙/Documents/GitHub/mtcnn_demo/queue_main.py
Traceback (most recent call last):
File "c:/Users/山河已无恙/Documents/GitHub/mtcnn_demo/queue_main.py", line 26, in <module>
from redis_uits import RedisClient
File "c:\Users\山河已无恙\Documents\GitHub\mtcnn_demo\redis_uits.py", line 14, in <module>
import redis
File "C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn\lib\site-packages\redis\__init__.py", line 3, in <module>
from redis import asyncio # noqa
File "C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn\lib\site-packages\redis\asyncio\__init__.py", line 1, in <module>
from redis.asyncio.client import Redis, StrictRedis
File "C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn\lib\site-packages\redis\asyncio\client.py", line 32, in <module>
from redis.asyncio.connection import (
File "C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn\lib\site-packages\redis\asyncio\connection.py", line 6, in <module>
import ssl
File "C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed while importing _ssl: 找不到指定的模块。
PS C:\Users\山河已无恙\Documents\GitHub\mtcnn_demo>
尝试重新 安装 opensssl
(mtcnn) C:\Users\liruilong>conda install openssl
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.11
latest version: 23.9.0
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: C:\Users\liruilong\AppData\Local\conda\conda\envs\mtcnn
added / updated specs:
- openssl
The following packages will be UPDATED:
ca-certificates: 2023.05.30-haa95532_0 --> 2023.08.22-haa95532_0
openssl: 1.1.1v-h2bbff1b_0 --> 1.1.1w-h2bbff1b_0
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(mtcnn) C:\Users\liruilong>
然后在 anaconda
环境中执行,发现在anaconda 的 conda 可以执行成功,但是在 命令行通过上面的方式执行不成功。
(mtcnn) C:\Users\liruilong\Documents\GitHub\mtcnn_demo>python queue_main.py
2023-10-25 03:39:15,665 - globals.py[line:27] - INFO: 🚀🚀🚀🚀 人脸检测相关模型加载
2023-10-25 03:39:16,483 - globals.py[line:29] - INFO: 🚀🚀🚀🚀 构建上下文对象
2023-10-25 03:39:16,483 - globals.py[line:31] - INFO: 🚀🚀🚀🚀🚀 服务启动成功
加油,愿被这世界温柔以待 ^_^