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.

Import error when using numpy 1.15

See original GitHub issue

Importing numexpr 2.7.2 fails with ImportError: numpy.core.multiarray failed to import when using numpy 1.15 (but works with 1.16):

(py36_test) C:\Users\KANDERSO\projects\rdtools>pip show numexpr
Name: numexpr
Version: 2.7.2
...

(py36_test) C:\Users\KANDERSO\projects\rdtools>pip install numpy==1.16
Collecting numpy==1.16
  Using cached numpy-1.16.0-cp36-cp36m-win_amd64.whl (11.9 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.15.0
    Uninstalling numpy-1.15.0:
      Successfully uninstalled numpy-1.15.0
Successfully installed numpy-1.16.0

(py36_test) C:\Users\KANDERSO\projects\rdtools>python -c "import numexpr"

(py36_test) C:\Users\KANDERSO\projects\rdtools>pip install numpy==1.15
Collecting numpy==1.15
  Using cached numpy-1.15.0-cp36-none-win_amd64.whl (13.5 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.16.0
    Uninstalling numpy-1.16.0:
      Successfully uninstalled numpy-1.16.0
Successfully installed numpy-1.15.0

(py36_test) C:\Users\KANDERSO\projects\rdtools>python -c "import numexpr"
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\KANDERSO\Software\Anaconda3\envs\py36_test\lib\site-packages\numexpr\__init__.py", line 26, in <module>
    from numexpr.interpreter import MAX_THREADS, use_vml, __BLOCK_SIZE1__
ImportError: numpy.core.multiarray failed to import

I know numpy 1.15 isn’t very recent anymore, but based on requirements.txt I think numpy>=1.7 is supposed to be supported right? Version info:

>>> sys.version
'3.6.12 |Anaconda, Inc.| (default, Sep  9 2020, 00:29:25) [MSC v.1916 64 bit (AMD64)]'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
FrancescAltedcommented, Jan 5, 2021

We are in 2021, so I would suggest to just drop support for Python 2.7.

1reaction
robbmcleodcommented, Jan 4, 2021

@kanderso-nrel What I’m thinking is trying to change setuptools build_requires when its running the command bdist_wheel. Then I can setup in GitHub Actions per-job pins for numpy to use the oldest reasonable version for each version of Python.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no module error when using numpy-1.15.0
I am trying to compile a python program where I am using numpy.random.choices(). once I compile I get this one error: ImportError: No...
Read more >
Troubleshooting ImportError — NumPy v1.24 Manual
Importing the numpy c-extensions failed. This error can happen for different reasons, often due to issues with your setup. The error also has...
Read more >
How To Import Numpy In Python
Before you can import numpy, you first need to install it. ... The simplest way to install numpy is to use the pip...
Read more >
Error Message "Please upgrade numpy to >= xxx to use ...
The error message. ... Please upgrade numpy to >= 1.15.4 to use this pandas version ... import os os.system("pip uninstall -y numpy") os.system('rm...
Read more >
Numpy 1.15.2 in Learn Python: pipenv
ERROR : Command errored out with exit status 1: /Users/test/.local/share/virtualenvs/project-2-rAt8MexF/bin/python -u -c 'import io, os, sys, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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