Jupyter notebook does not launch (ImportError: DLL load failed while importing)

冷暖自知 提交于 2021-01-24 08:54:52

问题


Recently my jupyter notebook stopped launching. When I try the command jupyter notebook from anaconda prompt but it gives error

Traceback (most recent call last): File "C:\Users\Dell\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in from notebook.notebookapp import main
File "C:\Users\Dell\anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in from zmq.eventloop import ioloop
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq_init_.py", line 50, in from zmq import backend
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend_init_.py", line 40, in reraise(*exc_info)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise raise value
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend_init_.py", line 27, in ns = select_backend(first)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend mod = import(name, fromlist=public_api)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend\cython_init
.py", line 6, in from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.

I even tried reinstalling anaconda and upgraded to python 3.8.3 on windows 10 but still get the same error. When I tried to check jupyter notebook's version it said that ipykernel and some other things were not installed. jupyter --version gives me this:

jupyter core : 4.6.3
jupyter-notebook : 6.1.1
qtconsole : 4.7.6
ipython : 7.18.1
ipykernel : not installed
jupyter client : not installed
jupyter lab : not installed
nbconvert : 5.6.1

But installing ipykernel with conda install ipykernel says

All requested packages already installed.

I also tried ipython kernel install --name <env_name> --user but this gives another dll error.

Reading some other problems in stackoverflow I went and checked my enviroment variables.

System Variables

User Variables

Is there a problem with this environment variable. Please help.

Screenshot of the anaconda prompt with error. Screenshot of the anaconda prompt

Edit: The anaconda navigator does not launch either. anaconda-navigator on the anaconda prompt gives another error: Anaconda navigator error

I also tried:

conda install qt --force
conda install pyqt --force

But that did'nt help. Does previously installed anaconda cause such error?


回答1:


I found what I did wrong (silly me). Microsoft visual C++ 2015-2019 was somehow removed when I tried to install openCV manually. Didn't think that such an install would make such big impact, have to keep that in mind now but installing the latest solved all the problems.

P.S.: This solution might not work for someone else with similar problem. But its worth taking a note.




回答2:


Just for other people having similar issue.

In my case, when I run jupyter notebook on command line, I got the same error as @Anav Katwal . However if I run jupyter notebook on Anaconda Prompt, then the error is gone.

If you truly want to execute jupyter notebook on cmd, then you could add the following paths to your system environment variable:

  • C:\Users\USERNAME\anaconda3\Library\bin
  • C:\Users\USERNAME\anaconda3\Scripts
  • C:\Users\USERNAME\anaconda3\condabin



回答3:


Use this code, instead of conda

pip install jupyter


来源:https://stackoverflow.com/questions/63979186/jupyter-notebook-does-not-launch-importerror-dll-load-failed-while-importing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!