Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
635 views
in Technique[技术] by (71.8m points)

python - 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:Anaconda3envsestlibsite-packages
umpy\__init__.py", line 180, in <module>
    from . import add_newdocs
  File "C:Anaconda3envsestlibsite-packages
umpyadd_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:Anaconda3envsestlibsite-packages
umpylib\__init__.py", line 8,
 in <module>
    from .type_check import *
  File "C:Anaconda3envsestlibsite-packages
umpylibype_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:Anaconda3envsestlibsite-packages
umpycore\__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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Uninstall and install numpy again.

pip uninstall numpy
pip install numpy

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...