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

时间:2020-01-16 11:05:55

标签: python jupyter-notebook anaconda jupyter

我刚刚在Windows 10上安装了最新的Anaconda,并希望使用anaconda提示符启动jupyter笔记本,但是会出现以下错误。尽管我认为这是一个普遍的问题,但我找不到解决方案。

(base) C:\Users\Felix>jupyter notebook
Traceback (most recent call last):
  File "C:\Users\MyUser\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "C:\Users\MyUser\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 62, in <module>
    from tornado import httpserver
  File "C:\Users\MyUser\Anaconda3\lib\site-packages\tornado\httpserver.py", line 29, in <module>
    import ssl
  File "C:\Users\MyUser\Anaconda3\lib\ssl.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

1 个答案:

答案 0 :(得分:2)

在这种情况下出现错误的原因是,在Anaconda的DLL之前已加载了一些不兼容的DLL。 One of the solutions将通过在Anaconda提示符下设置相应的控制环境变量来使用特殊的Anaconda DLL加载模式:

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1

P.S .:不要在每次启动时都手动设置变量,可以将其设置为system environment variable