Reputation: 869
I installed python3 in my macOS through brew,
I installed opencv and numpy,
when I import cv2 and numpy I have this error
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Traceback (most recent call last):
File "001.py", line 2, in <module>
import cv2
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 89, in <module>
bootstrap()
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 79, in bootstrap
import cv2
ImportError: numpy.core.multiarray failed to import
Upvotes: 2
Views: 812
Reputation: 869
I fix the problem in this way:
brew install opencv
pip install opencv-python
sudo rm -rf /usr/local/lib/python3.7/site-packages/numpy
sudo ln -s /usr/local/Cellar/numpy/1.17.1/lib/python3.7/site-packages/numpy /usr/local/lib/python3.7/site-packages/numpy
Upvotes: 1