I have anaconda installed and I have changed the interpreter on the top right to my anaconda environment. When imported a library I am getting the following error
ImportError: DLL load failed: The specified module could not be found
I have added the following variables in PATH
C:Usersnameanaconda3 C:Usersnameanaconda3Scripts C:Usersnameanaconda3Library C:Usersnameanaconda3Librarybin C:Usersnameanaconda3Librarymingw-w64bin
I have added the following variables in Preferences:Settings(JSON)
"terminal.integrated.shell.windows": "C:\Windows\System32\cmd.exe", "terminal.integrated.shellArgs.windows": ["/K", "C:\Users\name\anaconda3\Scripts\activate.bat C:\Users\name\anaconda3"], "python.condaPath": "C:\Users\name\anaconda3\conda.exe"
None of the solutions worked.
Advertisement
Answer
Posting the answer if anyone is stuck on the same issue. After trying the two above-mentioned steps. I have opened the terminal in VS code and activated my environment
conda activate myenv
Next run
>code .
in the VS code’s terminal. If it does not work close VS code and repeat this step.
If the issue still persists then
- Open anaconda prompt.
- Change the directory to location where jupyter notebook is preset.
- execute
code .
- Try running the import statement now.