【发布时间】:2017-08-23 17:12:18
【问题描述】:
我使用 MSYS2 安装了 Python 3.6 (mingw-w64-x86_64-python3) 的 MinGW-W64 版本。导入 ssl 时,会引发 ImportError:
$ python3
Python 3.6.2 (default, Aug 15 2017, 10:59:43) [GCC 7.1.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "G:/msys64/mingw64/lib/python3.6\ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified procedure could not be found.
>>>
我不确定这是为什么。 pacman 显示已安装的 mingw-w64-x86_64-openssl 和 openssl。 /mingw64/lib/python3.6/lib-dynload/_ssl-cpython-36m.dll 存在。来自同一目录的其他 .dll 文件(如用于 json 和 sqlite3 模块的文件)可以正常导入。
更奇怪的是,Python 2 版本 (mingw-w64-x86_64-python2) 没有这个问题。
【问题讨论】:
-
我遇到了同样的问题。我在这里举报了:github.com/Alexpux/MINGW-packages/issues/3381
标签: python python-3.x ssl mingw pyopenssl