3

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.

3
  • 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. Commented Feb 9, 2020 at 11:58
  • I also tried pip install command (not conda) but i got the exact same error. Commented Feb 9, 2020 at 15:43
  • Could you figure out? I'm having same issue. Commented Jun 4, 2020 at 8:52

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

1 Comment

Installing the scipy 1.5.4 wheel from GitHub also worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.