Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy ImportError: DLL load failed: The specified module could not be found. #9218

Closed
jbmoorhouse opened this issue Dec 19, 2019 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@jbmoorhouse
Copy link

Environment data

  • VS Code version: 1.41.0
  • Extension version (available under the Extensions sidebar): 2019.11.50794
  • OS and version: Windows 10.0.18362
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.5 64-bit conda 4.8.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: numpy
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Jedi Enabled

Expected behaviour

Load numpy as normal. Python and Numpy were installed using the guidelines from Anaconda. Numpy works in the Anaconda prompt and also in a VSCode Jupyter notebook. When attempting to import numpy in any .py file, the error shown occurs when the file is "Run in the Terminal"

Actual behaviour

ImportError: DLL load failed: The specified module could not be found.

Steps to reproduce:

import numpy

Logs

ImportError: DLL load failed: The specified module could not be found.

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.7 from "C:\Users\....\Anaconda3\python.exe",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.4" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: DLL load failed: The specified module could not be found.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Tried this but got.

Uncaught SyntaxError: Unexpected identifier
@jbmoorhouse jbmoorhouse added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Dec 19, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Dec 19, 2019
@karrtikr
Copy link

Hi @jbmoorhouse ,
Please try the steps mentioned in the log if you haven't tried them already.

What command does the extension send in terminal? If it's the right command, this issue is not related to the extension.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Dec 19, 2019
@jbmoorhouse
Copy link
Author

Hi @karrtikr

Thanks for your comments. I'm not sure if I interpreted your suggestions as intended, but they nevertheless helped me to solve the issue.

I didn't realise that conda activate env was failing in the terminal. As a result, VSCode was instead using another version of Python, which presumably has a broken version of numpy. I didn't realise that VSCode code should be launched from the Anaconda prompt, so that conda can activate the desireed environment.

Thanks for your help. For reference this post also helped.

@ghost ghost removed the triage label Dec 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants