无法在 Anaconda3 中启动 jupyter 笔记本,因为导入_ssl错误



我刚刚在 Windows 10 上安装了最新的 Anaconda,并想使用 anaconda 提示符启动 jupyter 笔记本,但发生了以下错误。虽然我认为这是一个常见问题,但我找不到解决方案。

(base) C:UsersFelix>jupyter notebook
Traceback (most recent call last):
File "C:UsersMyUserAnaconda3Scriptsjupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:UsersMyUserAnaconda3libsite-packagesnotebooknotebookapp.py", line 62, in <module>
from tornado import httpserver
File "C:UsersMyUserAnaconda3libsite-packagestornadohttpserver.py", line 29, in <module>
import ssl
File "C:UsersMyUserAnaconda3libssl.py", line 98, in <module>
import _ssl             # if we can't import it, let the error propagate
ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

加法: 我不能用pip来安装东西。出现以下消息

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

在这种情况下,错误的原因是一些不兼容的DLL在Anaconda的DLL之前加载。解决方案之一是通过在 Anaconda 提示符中设置相应的控制环境变量来使用特殊的 Anaconda DLL 加载模式:

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

PS:不是每次启动时都手动设置变量,您可以将其设置为系统环境变量。

相关内容

最新更新