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

Import NumPy error #12960

Closed
jlapin1 opened this issue Feb 13, 2019 · 7 comments
Closed

Import NumPy error #12960

jlapin1 opened this issue Feb 13, 2019 · 7 comments
Labels
29 - Intel/Anaconda 32 - Installation Problems installing or compiling NumPy

Comments

@jlapin1
Copy link

jlapin1 commented Feb 13, 2019

Hello all

This morning I downloaded numba as well as updated all packages with conda update --all. I get an error when trying to import numpy. The message in the ipython console prompted me to post on Github. The exact error message is:

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

Some notes about my Anaconda/spyder environment

  • Both python and numpy were updated with the updates this morning
  • I am working on windows 10
  • I have had other python interpreters for awhile now. The other one is used in an ubuntu on windows virtual machine. But I did check to make sure the path to site-packages was correct in spyder.

I have seen similar posts from 2 days ago but I couldn't find any solutions that worked for me.

Thanks in advance
-Joel

@ismailfarooq1
Copy link

Hey, I'm having the same problem but can't figure out the solution. I hope someone helps us soon!

@jlapin1
Copy link
Author

jlapin1 commented Feb 15, 2019

Perhaps this is frowned upon by the software developement community, but I got impatient, saved all my Python scripts, and uninstalled/reinstalled Anaconda. Everything is fine now, but I am hesitant to upgrade any packages such that I encounter this pitfall again.

@ismailfarooq1
Copy link

That's great for you.
This is the error I'm getting and I really don't want to uninstall anaconda. Maybe I will but can you have a look at the error below and tell me what to do? I really need some help.

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy\core_init_.py", line 16, in
from . import multiarray
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy\core\multiarray.py", line 12, in
from . import overrides
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy\core\overrides.py", line 6, 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:/Users/ismae/PycharmProjects/test3/yolo", line 1, in
import tensorflow as tf
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\tensorflow\python_init_.py", line 47, in
import numpy as np
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy_init_.py", line 142, in
from . import core
File "C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy\core_init_.py", line 47, in
raise ImportError(msg)
ImportError:

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

Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:

  • If you're working with a numpy git repository, try git clean -xdf
    (removes all files not under version control) and rebuild numpy.
  • If you are simply trying to use the numpy version that you have installed:
    your installation is broken - please reinstall numpy.
  • If you have already reinstalled and that did not fix the problem, then:
    1. Check that you are using the Python you expect (you're using C:\ProgramData\Anaconda3\envs\tf-1_9-36\python.exe),
      and that you have no directories in your PATH or PYTHONPATH that can
      interfere with the Python and numpy versions 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

      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.

@mattip
Copy link
Member

mattip commented Feb 15, 2019

Duplicate of #12957 due to ContinuumIO/anaconda-issues#10628. Copied comment from the duplicate issue:

There is a difference between the location of the extra support libraries supplied with anaconda and those supplied with stock numpy that you get from pip install. This requires adjustments to the PATH variable. Perhaps the PATH adjustments are failing at import. Does the site-packages\numpy\.libs directory exist and does it contain *.dll files?, If so, can you try to prepend that directory to your PATH before running python:

rem This fails
python -c "import numpy"

rem Does this succeed ??? 
PATH=path\to\site-packages\numpy\.libs;%PATH%
python -c "import numpy"

For @ismailfarooq1, the path to site-packages is C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages so the path that needs to be added before running python (or pycharm, or vs-coder) is PATH=C:\ProgramData\Anaconda3\envs\tf-1_9-36\lib\site-packages\numpy\.libs;%PATH%

@jlapin1 you do not include any version information so it is difficult to assist you.

@ismailfarooq1
Copy link

I'm using python version 3.6. PYCharm version 2018-3.4
I'm sorry but I'm new to this and if you could be specific about the version you're asking for.
On the other hand, when I ran the cmd command above it was successful!
But the Pycharm is still giving me the same error.

@mattip
Copy link
Member

mattip commented Feb 16, 2019

You need to run PyCharm from the command prompt (DOS window) after you have issued the command to change the path. For the exact command to start PyCharm, right-click on the PyCharm shortcut and find the command run by it.

@rgommers rgommers added the 32 - Installation Problems installing or compiling NumPy label Dec 3, 2019
@mattip
Copy link
Member

mattip commented Dec 2, 2020

Closing. I assume the reporters have solved their installation problems. Please open a new issue as needed.

@mattip mattip closed this as completed Dec 2, 2020
@numpy numpy deleted a comment from kingsyard May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
29 - Intel/Anaconda 32 - Installation Problems installing or compiling NumPy
Projects
None yet
Development

No branches or pull requests

4 participants