【发布时间】:2018-04-04 23:41:42
【问题描述】:
我正在尝试在我的 mac 上安装 OpenCV-python,我使用了以下内容:
$pip 安装 opencv-python
这给了我以下错误:
$pip install opencv-python
Collecting opencv-python
Using cached opencv_python-3.4.0.12-cp27-cp27m macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.11.1 (from opencv-python)
Using cached numpy-1.14.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: numpy, opencv-python
Found existing installation: numpy 1.8.0rc1
Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
然后我确实尝试了pip install --upgrade matplotlib,它没有改变任何东西。它只是告诉我:
matplotlib 2.2.2 requires backports.functools-lru-cache, which is not installed.
matplotlib 2.2.2 has requirement numpy>=1.7.1, but you'll have numpy 1.8.0rc1 which is incompatible.
我在网上找到了许多安装 openCV-python 的方法,例如: https://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/
我安装在我的另一台 Mac 上,但我的代码中有很多导入 cv2 问题。 如果有人有安装 openCV-python 的好解决方案或建议,我将非常高兴。
谢谢
【问题讨论】:
-
如果您使用的是 mac,请使用
homebrew来(重新)安装 python 和 pip。然后你也可以使用brew install opencv3 --with-python来安装opencv。 Mac内置的python对我来说一直是个问题。 -
你能把库安装在virtualenv吗?
-
类似问题here
标签: python python-2.7 opencv opencv-python