在安装OpenCV 4.1时出错

时间:2019-10-16 11:52:38

标签: python opencv anaconda conda

我想在执行OpenCV showwindow时放一个暂停键。我在Python的Anacoda虚拟环境下遇到此错误。

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvWaitKey, file /opt/conda/conda-bld/opencv_1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp, line 616
Traceback (most recent call last):
  File "test_Capture.py", line 27, in <module>
    k= cv2.waitKey(30) & 0xff
cv2.error: /opt/conda/conda-bld/opencv_1491943414359/work/opencv-3.1.0/modules/highgui/src/window.cpp:616: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvWaitKey

所以我尝试安装conda install -c conda-forge opencv = 4.1.0

(pytorch) dummy@dummy:~/Downloads/FaceRec$ conda install -c conda-forge opencv=4.1.0

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                               

UnsatisfiableError: The following specifications were found to be incompatible with each other:                                      



Package python conflicts for:
python==2.7.13=0
Package readline conflicts for:
python==2.7.13=0 -> readline[version='6.2|6.2.*']
opencv=4.1.0 -> python[version='>=3.6,<3.7.0a0'] -> readline[version='7.*|>=7.0,<8.0a0|>=8.0,<9.0a0']
Package tk conflicts for:
opencv=4.1.0 -> python[version='>=3.6,<3.7.0a0'] -> tk[version='8.6.*|>=8.6.7,<8.7.0a0|>=8.6.8,<8.7.0a0|>=8.6.9,<8.7.0a0']
python==2.7.13=0 -> tk[version='8.5.*|8.5.18']
Package sqlite conflicts for:
opencv=4.1.0 -> python[version='>=3.6,<3.7.0a0'] -> sqlite[version='>=3.20.1,<4.0a0|>=3.22.0,<4.0a0|>=3.23.1,<4.0a0|>=3.24.0,<4.0a0|>=3.25.1,<4.0a0|>=3.25.2,<4.0a0|>=3.25.3,<4.0a0|>=3.26.0,<4.0a0|>=3.27.2,<4.0a0|>=3.28.0,<4.0a0|>=3.29.0,<4.0a0']
python==2.7.13=0 -> sqlite=3.13
Package atk conflicts for:
opencv=4.1.0 -> qt[version='>=5.6.2,<5.7.0a0'] -> gtk2 -> atk[version='>=2.32.0,<3.0a0']

如何解决此错误?

注意:我正在使用Ubuntu 16.04 OS

0 个答案:

没有答案