I have installed NumPy version 1.19.5 for a python program (I am using python 3.6.8, so NumPy 1.19.5 is the latest version it accepts I think), using <pip3 install numpy==1.19.>. However, I keep getting the error message:

(base) Dhammas-MacBook-Air:python-code-r dhammaandrivini$ python3 traffic.py
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "traffic.py", line 1, in <module>
    import cv2
  File "/Users/dhammaandrivini/Library/Python/3.6/lib/python/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

The first lines of my code are below:

import cv2
import numpy as np
import os
import sys
import tensorflow as tf

from sklearn.model_selection import train_test_split

I would be very grateful for any help with this. I am not sure if the cv2 has anything to do with the numpy.core.multiarray not importing? Thank you :)

1 Answer 1


it seems your version is not up to date https://pypi.org/project/numpy/#history

It may help as I see some others experiencing the same issue https://stackoverflow.com/questions/20518632/importerror-numpy-core-multiarray-failed-to-import

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .