Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: DLL load failed when importing Numpy installed in conda virtual environment

In Windows, I created a Conda virtual environment with the command

conda create -n test python=2.7 pandas scipy matplotlib numpy 

Once it is created, I activated the virtual environment and went into a python interpreter. When trying to import numpy, I get the following error:

>>> import numpy Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "C:\Anaconda3\envs\test\lib\site-packages\numpy\__init__.py", line 180, in <module>     from . import add_newdocs   File "C:\Anaconda3\envs\test\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>     from numpy.lib import add_newdoc   File "C:\Anaconda3\envs\test\lib\site-packages\numpy\lib\__init__.py", line 8,  in <module>     from .type_check import *   File "C:\Anaconda3\envs\test\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>     import numpy.core.numeric as _nx   File "C:\Anaconda3\envs\test\lib\site-packages\numpy\core\__init__.py", line 14, in <module>     from . import multiarray ImportError: DLL load failed: The specified module could not be found. 

Any ideas what is going on here? Thanks!

like image 731
mkrems Avatar asked Apr 21 '16 18:04

mkrems


People also ask

How install Numpy package in Anaconda?

If you installed the Anaconda distribution of Python, NumPy comes pre-installed and no further installation steps are necessary. If you use a version of Python from python.org or a version of Python that came with your operating system, the Anaconda Prompt and conda or pip can be used to install NumPy.

How do I check Numpy version in Anaconda prompt?

Make sure you are using the Anaconda prompt, as the conda command only works in an Anaconda environment, and type conda list numpy . The result will show the version of numpy and associated packages.


1 Answers

Uninstall and install numpy again.

pip uninstall numpy pip install numpy 

Then try import again, it should work. That is what I did

like image 68
Victor O Avatar answered Sep 18 '22 21:09

Victor O