Python Forum
ImportError: numpy.core.multiarray failed to import
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ImportError: numpy.core.multiarray failed to import
#1
$ python -c 'import numpy; print(numpy.__file__)'

/usr/local/lib/python2.7/dist-packages/numpy/__init__.pyc

$ pip show numpy

Name: numpy

Version: 1.14.3

Summary: NumPy: array processing for numbers, strings, records, and objects.

Home-page: http://www.numpy.org

Author: Travis E. Oliphant et al.

Author-email: None

License: BSD

Location: /usr/local/lib/python3.5/dist-packages

Requires:

Required-by:

I have two python version installed in my ubuntu 16.04 python 2.7.12 (default) and python 3.5.2.

When am trying to import numpy and cv2 the following error shows :

ImportError: numpy.core.multiarray failed to import

probably the error is due to numpy version. How can I resolve this issue ??
Reply
#2
my first suggestion is to update python to 3.6.5, rather than running an antique version.

For Lniux, Use snippsat's tutorial here
For windows use This
Then, numpy should install with:
pip install numpy
Reply
#3
(Jun-12-2018, 02:15 PM)Larz60+ Wrote: Use snippsat's tutorial here

Larz, OP is on Ubuntu
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
(Jun-12-2018, 10:30 AM)Nimya Wrote: $ python -c 'import numpy; print(numpy.__file__)'

/usr/local/lib/python2.7/dist-packages/numpy/__init__.pyc

$ pip show numpy

Name: numpy

You could have used
Output:
$ python3 -c 'import numpy; print(numpy.__file__)' $ pip3 show numpy
(The latter if you have pip3 installed as distinct package - which you should have)

PS You have the right version of numpy installed - you just try to invoke it with the wrong version of Python
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 304 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Using multi-core and muliple processors Robots 1 726 Jan-01-2023, 12:54 AM
Last Post: Larz60+
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,530 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  import numpy problem ptnb 1 2,078 May-18-2020, 06:03 PM
Last Post: ptnb
  import numpy in sub-files paul18fr 1 1,987 Aug-06-2019, 12:38 PM
Last Post: chakrimakam
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,935 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  ImportError: DLL load failed: %1 is not a valid Win32 application. LiTing 1 12,159 Oct-14-2018, 09:52 PM
Last Post: snippsat
  not able to import numpy in pthon_d leiwengi 0 2,672 May-17-2018, 09:46 PM
Last Post: leiwengi
  ImportError: DLL load failed: The specified procedure could not be found. chess 1 4,161 Sep-17-2017, 10:12 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020