FileNotFoundError: Could not find module when using jupyter notebook

Viewed 10094

When I try to use jupyter notebook, I got the following error message:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-8ec26a89e3fd> in <module>
      4 import matplotlib
      5 import matplotlib.pyplot as plt
----> 6 from scipy.io import loadmat
      7 import time
      8 import sys

D:\Anaconda3\lib\site-packages\scipy\__init__.py in <module>
    128 
    129     # Allow distributors to run custom init code
--> 130     from . import _distributor_init
    131 
    132     from scipy._lib import _pep440

D:\Anaconda3\lib\site-packages\scipy\_distributor_init.py in <module>
     57             os.chdir(libs_path)
     58             for filename in glob.glob(os.path.join(libs_path, '*dll')):
---> 59                 WinDLL(os.path.abspath(filename))
     60         finally:
     61             os.chdir(owd)

D:\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    371 
    372         if handle is None:
--> 373             self._handle = _dlopen(self._name, mode)
    374         else:
    375             self._handle = handle

FileNotFoundError: Could not find module 'D:\Anaconda3\lib\site-packages\scipy\.libs\libbanded5x.EHDKC2XVYTQQ5MALRS6XN2CUSS6SRL6P.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

But I am sure that the file is right there in the folder. Can anyone help me?

5 Answers

Same problem occured when trying to import sklearn. The version of my scipy is 1.6.3 and i solved the problem by degrading scipy into 1.6.2

It seems to be pretty common when installing scipy. You could try the downgrade, but that did not work for me.

I found that re-installing scipy using:

pip install scipy==1.6.3 --user 

worked to install the missing file.

Same problem while trying to import tensorflow!

FileNotFoundError: Could not find module 'C:\anaconda3\envs\test\lib\site-packages\scipy.libs\libbanded5x.EHDKC2XVYTQQ5MALRS6XN2CUSS6SRL6P.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

(the file is there)

Reverting scipy (from 1.7.3 back to 1.6.3) or changing scipy version to any other one didn't work for me. What did work, however, is setting up an environmental variable CONDA_DLL_SEARCH_MODIFICATION_ENABLE to 1 (as suggested here). This can be a workaround until the devs fix this.

Delete the spicy folder in the environment "\miniconda\envs\env_name\Lib\site-packages\spicy" Reinstall using cell magic in the jupyter notebook

!pip install spicy
Related