Anaconda ImportError: DLL load failed: Cannot find the solution for the specified module

同样work for jupyter notebook in vscode using conda environments

 

(Faults and solutions under Windows)

In the morning, I installed a VS code and configured the Python development environment. Try to run a few simple codes while searching for useful plug-ins on the Internet to install. Suddenly the code can't run in the afternoon, and there is a problem in import numpy, prompt:

from . import _mklinit 
ImportError: DLL load failed: 找不到指定的模块。

VS code also prompts to install pylint, and it also says that it cannot be installed due to network failure.

I wonder if this does not make me play, let’s take a look at which Python interpreter is. Obviously Anaconda is fine. My sister installs another version of Python. Searching for solutions on the Internet is the simplest and rude. Reinstalling numpy is not easy to use. Then I saw some blogs saying to add Anaconda environment variables, such as this one , and this one , thank you for sharing .

I said to my heart that when I installed Anaconda, I chose to add environment variables. Why can there be problems? The code can run in the morning, but the environment variables are gone in the afternoon? With that said, let's try it.

So I right-clicked my computer-properties-advanced system settings-environment variables-variable PATH-edit-new, and found that there is no Anaconda, so I still disappeared.

(Don’t ask me why I don’t need cmd to add PATH, because I’m too silly to see the graphical interface and I don’t know what to do)

Put

X:\ProgramData\Anaconda3
X:\ProgramData\Anaconda3\Scripts
(根据情况改成您自己的路径)

These two lines were added, but an error was reported. Look at the solutions on the Internet and add another line

X:\ProgramData\Anaconda3\Library\bin
(根据情况改成您自己的路径)

Just try again now.

Guess you like

Origin blog.csdn.net/weixin_51267929/article/details/114241929