Skip to content
Advertisement

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

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:UsersDellanaconda3Scriptsjupyter-notebook-script.py”, line 6, in from notebook.notebookapp import main
File “C:UsersDellanaconda3libsite-packagesnotebooknotebookapp.py”, line 51, in from zmq.eventloop import ioloop
File “C:UsersDellanaconda3libsite-packageszmq_init_.py”, line 50, in from zmq import backend
File “C:UsersDellanaconda3libsite-packageszmqbackend_init_.py”, line 40, in reraise(*exc_info)
File “C:UsersDellanaconda3libsite-packageszmqutilssixcerpt.py”, line 34, in reraise raise value
File “C:UsersDellanaconda3libsite-packageszmqbackend_init_.py”, line 27, in ns = select_backend(first)
File “C:UsersDellanaconda3libsite-packageszmqbackendselect.py”, line 28, in select_backend mod = import(name, fromlist=public_api)
File “C:UsersDellanaconda3libsite-packageszmqbackendcython_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?

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement