我想将opencv与python一起使用,但我认为我的numpy版本存在问题。 如何确保opencv使用正确的numpy版本?
我做了
sudo pip install opencv-python
我收到了这条消息
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
现在我尝试
import cv2
我得到了
ImportError: numpy.core.multiarray failed to import
我还用
更新了我的numpy版本sudo pip install -U numpy
答案 0 :(得分:2)
如果您在计算机上同时使用Py2.7和3.5,请确保通过python3 -m pip install numpy -I
执行任何正确版本的numpy
或python2 -m pip install numpy -I