question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numpy wont import in Python 3 in anaconda env

See original GitHub issue

I am using anaconda2 to manage my environments. I am setting up an enviornment to run a colleague’s code. I had to use pip to install the version of PyQT5 he has. I tried installing numpy with conda, and with pip, but to no avail either way it refuses to import.

Reproducing code example:

from pycharm python console using this environment: import numpy

import numpy as np

Error message:

C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py:20: UserWarning: mkl-service package failed to import, therefore Intel® MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service module = self.system_import(name, *args, **kwargs) Traceback (most recent call last): File "C:\Users\bloomqui\Anaconda2\envs\tubeinfo\lib\site-packages\numpy\core_init.py", line 24, in <module> from . import multiarray File “C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 20, in do_import module = self._system_import(name, *args, **kwargs) File “C:\Users\bloomqui\Anaconda2\envs\tubeinfo\lib\site-packages\numpy\core\multiarray.py”, line 14, in <module> from . import overrides File “C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 20, in do_import module = self._system_import(name, *args, **kwargs) File “C:\Users\bloomqui\Anaconda2\envs\tubeinfo\lib\site-packages\numpy\core\overrides.py”, line 7, in <module> from numpy.core._multiarray_umath import ( File “C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 20, in do_import module = self._system_import(name, *args, **kwargs) 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 “”, line 1, in <module> File “C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 20, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\bloomqui\Anaconda2\envs\tubeinfo\lib\site-packages\numpy_init.py", line 142, in <module> from . import core File “C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 20, in do_import module = self.system_import(name, *args, **kwargs) File "C:\Users\bloomqui\Anaconda2\envs\tubeinfo\lib\site-packages\numpy\core_init.py", line 54, in <module> raise ImportError(msg) ImportError: 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\bloomqui\Anaconda2\envs\tubeinfo\python.exe”, and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy version “1.18.1” 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.

Numpy/Python version information:

Base environment: anaconda 2019.10 (Fresh re-install) conda 4.8.2 Environment for code: Python 3.7.6 numpy 1.18.8 (currently installed via pip) PyQt5 5.14.1 (installed via pip)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

16reactions
mattipcommented, Feb 6, 2020

Did you activate the conda environment by running path\to\anaconda\Scripts\activate?

2reactions
AiliMakicommented, Feb 6, 2020

I just made a brand new environment with Python 3.7.6 and installed numpy 1.18.1 (using conda). Numpy still fails to import.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing Numpy results in error even though Anaconda says ...
Numpy is working when I run python 3.4.4 in pycharm, but it will not work in either anaconda2 nor anaconda3.. this makes no...
Read more >
Troubleshooting ImportError — NumPy v1.24 Manual
Using VSCode with Anaconda/conda Python (or environments)#. A commonly reported issue is related to the environment activation within VSCode. Please see the ...
Read more >
PyCharm can't import numpy after fresh MiniConda install
I was previously using PyCharm for a project, but needed to replace my anaconda installation with a miniconda one. After installing, I'm...
Read more >
Managing packages - Conda
To install a specific package such as SciPy into an existing environment ... To install a package for a specific Python version: ......
Read more >
Installing scikit-learn
Install the 64bit version of Python 3, for instance from ... If you have not installed NumPy or SciPy yet, you can also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found