formulahendry / formulahendry/vscode-code-runner

[Bug] DLL load failed: The specific module could not be found (Numpy, Anaconda)

Open
#576 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
351
PR merge metrics
No merged PRs in 30d

Description

Error occurs upon `import numpy as np`; command works fine when typed directly in terminal, but fails when ran via Code Runner. My steps to reproduce below.

Output of `import sys; print(sys.version)` is `3.7.5 (default, Oct 31 2019, 15:18:51) [MSC v.1916 64 bit (AMD64)]`. VSCode shows it's running the expected Python interpreter: `Python 3.7.5 64-bit ('vsc': conda)` at bottom-left pane (see clip). -- Brief [video demo](https://www.dropbox.com/s/cu4vzyp8ybdq6qo/np_demo.mp4?dl=0).


**Note**: both per related [Git](https://github.com/numpy/numpy/issues/15183) and [SO](https://stackoverflow.com/questions/59519338/dll-load-failed-the-specific-module-could-not-be-found-vscode-numpy), Code Runner was named as a culprit - hence my post here.


**Env info**: Windows 10 x64, Anaconda 10/19 (virtual env), VSCode 1.41.1


**Steps to reproduce:**

```
conda create --name vsc
conda activate vsc
conda install python==3.7.5
conda install numpy
# in VSCode: import numpy as np, etc
```


**Full traceback**:

```python
Traceback (most recent call last):
File "D:\Anaconda\envs\vsc\lib\site-packages\numpy\core\__init__.py", line 17, in
from . import multiarray
File "D:\Anaconda\envs\vsc\lib\site-packages\numpy\core\multiarray.py", line 14, in
from . import overrides
File "D:\Anaconda\envs\vsc\lib\site-packages\numpy\core\overrides.py", line 7, in
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Desktop\School\Python\vscode\HelloWorld\app.py", line 1, in
import numpy as np
File "D:\Anaconda\envs\vsc\lib\site-packages\numpy\__init__.py", line 142, in
from . import core
File "D:\Anaconda\envs\vsc\lib\site-packages\numpy\core\__init__.py", line 47, in
raise ImportError(msg)
ImportError:
```


**All enabled extensions**, sorted alphabetically:

- Anaconda Extension Pack (1.0.1)
- AREPL for python (1.0.20)
- Blade Runner - Run task When Open (1.0.0)
- Bootstrap 4, Font awesome 4, Font Awesome 5 Free & Pro snippets for Visual studio code (6.1.0)
- Bracket Light Pro (0.4.3)
- C/C++ (0.26.3-insiders2)
- C++ Algorithm Mnemonics (1.0.3)
- Code Runner (0.9.15)
- Django (0.19.0)
- Font Switcher (3.1.0)
- Glasslt-VSC (0.1.6)
- HTML CSS Support (0.2.3)
- kite (0.102.0)
- MagicPython (1.1.0)
- One Dark Pro (3.2.1)
- Python (2019.11.50794)
- Python Extension Pack (1.6.0)
- Theme by language (1.1.1)
- Visual Studio IntelliCode (1.2.2)
- YAML (0.6.1)


**settings.json**:

```json
{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"glassit.alpha": 250,
"editor.autoClosingBrackets": "never",
"editor.autoClosingQuotes": "never",
"editor.multiCursorModifier": "alt",
"workbench.colorTheme": "One Dark Pro",
"font-switcher.enableLivePreview": true,
"theme-by-language.themes": {
"c": "One Dark Pro",
"*": "One Dark Pro",
"python": "One Dark Pro"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.jediEnabled": false,
"window.zoomLevel": 0,
"editor.minimap.enabled": false,
"python.formatting.provider": "autopep8",
"[python]": {
"editor.defaultFormatter": "ms-python.python"
},
"C_Cpp.updateChannel": "Insiders",
"kite.showWelcomeNotificationOnStartup": false,

"code-runner.executorMap": {
"python":"$pythonPath $fullFileName",
},
"code-runner.showExecutionMessage": false,
"code-runner.saveFileBeforeRun": true,

"terminal.integrated.shellArgs.windows": ["/K", "D:\\Anaconda\\Scripts\\activate.bat D:\\Anaconda"],
"python.condaPath": "D:\\Anaconda\\Scripts\\conda.exe"
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.