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
194 views
in Technique[技术] by (71.8m points)

python - PyDev/Eclipse not loading _mklinit when run from a Conda environment

I created a conda environment - testenv2 - installed python/numpy/pandas. Added it as the interpreter in Eclipse project settings and using it to run my test python script. And I am getting the below error. The same test script works fine from command line when I activate the conda environment and run from with in it. It also works from PyCharm. But somehow fails to launch in Eclipse.

Traceback (most recent call last):
  File "C:Dataprojectseclipse-workspacePythonEclipseTest.py", line 1, in <module>
    import numpy as np
  File "C:DatadevtoolsAnaconda3envsestenv2libsite-packages
umpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:DatadevtoolsAnaconda3envsestenv2libsite-packages
umpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

If I just run the same test script using my root Conda Python interpreter, it works fine. So it is only when I try to use the environment I created from conda.

Thanks for the help!

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

Add CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1 to your environment variables.

For VSCode, either an .env file in your workspace folder or "env" key in launch.json should do the trick.

Source: https://docs.conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#numpy-mkl-library-load-failed


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

...