Reputation: 438
I would like to use opencv with python, but I think I have a problem with my numpy version. How can I make sure that opencv uses the right numpy version?
I did
sudo pip install opencv-python
And I received this message
Installing collected packages: numpy, opencv-python
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
Successfully uninstalled numpy-1.8.0rc1
Successfully installed numpy-1.14.5 opencv-python-3.4.1.15
Now when I try
import cv2
I get
ImportError: numpy.core.multiarray failed to import
I also updated my numpy version with
sudo pip install -U numpy
Upvotes: 2
Views: 797
Reputation: 465
If you are using both Py2.7 and 3.5 on your machine, make sure numpy is being installed for the correct version by doing either python3 -m pip install numpy -I
or python2 -m pip install numpy -I
Upvotes: 2