3
votes

I have a problem importing scipy.optimize, as well as other scipy's modules. Every time I run the code I get the following error:

File "C:/Users/project/test.py", line 4, in from scipy.optimize import *

File "C:\Users\project\venv\lib\site-packages\scipy__init__.py", line 156, in from . import fft

File "C:\Users\project\venv\lib\site-packages\scipy\fft__init__.py", line 76, in from ._basic import (

File "C:\Users\project\venv\lib\site-packages\scipy\fft_basic.py", line 1, in from scipy._lib.uarray import generate_multimethod, Dispatchable

File "C:\Users\project\venv\lib\site-packages\scipy_lib\uarray.py", line 27, in from ._uarray import *

File "C:\Users\project\venv\lib\site-packages\scipy_lib_uarray__init__.py", line 114, in from ._backend import *

File "C:\Users\project\venv\lib\site-packages\scipy_lib_uarray_backend.py", line 15, in from . import _uarray # type: ignore

ImportError: DLL load failed: The specified module could not be found.

I tried reinstalling both numpy and scipy as well as installing scipy manually from here as some suggested, however nothing changed. I use Windows10 64b, Python 3.7.

1
Without the manual installation, how did you install NumPy and SciPy? Using a package-management system such as pip or conda? If not, you may want to look into one of those, as they streamline the process of ensuring that versions align and that DLLs end up in the right place (cf. what you're experiencing). If you do want to do things more manually, the error message would suggest that you need to add the relevant venv paths to your system path environment variable.fuglede
I also tried pip install command (not conda) but i got the exact same error.george doultsinos
Could you figure out? I'm having same issue.Prasad Ostwal

1 Answers

2
votes

I uninstalled SciPy 1.4.1 and installed SciPy 1.4.0. It resolved the problem.

pip uninstall scipy
pip install scipy==1.4.0