OpenCV not working properly with python on Linux with anaconda. Getting error that cv2.imshow() is not implemented

后端 未结 14 738
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 09:24

This is the exact error that I am getting. My OS is Ubuntu 16.10.

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with

相关标签:
14条回答
  • 2020-12-02 09:44

    For me (Arch Linux, Anaconda with Python 3.6), installing from the suggested channels menpo or loopbio did not change anything. My solution (see related question) was to

    1. install pkg-config (sudo pacman -Syu pkg-config),
    2. remove opencv from the environment (conda remove opencv) and
    3. re-install opencv from the conda-forge channel (conda install -c conda-forge opencv)

    conda list now returns opencv 3.3.0 py36_blas_openblas_203 [blas_openblas] conda-forgeand all windows launched using cv2 are working fine.

    0 讨论(0)
  • 2020-12-02 09:45

    1.The easiest way:

    conda remove opencv
    conda update conda
    conda install --channel menpo opencv
    

    or (for OpenCV 3.1) :

    conda install -c menpo opencv3
    

    2.And if u don't want to do this, you can try to use matplotlib .

    import cv2
    import matplotlib.pyplot as plt
    
    img = cv2.imread('img.jpg',0)
    
    plt.imshow(img, cmap='gray')
    plt.show()
    

    3.Or try to build library by your own with option WITH_GTK=ON , or smth like that.

    Update - 18th Jun 2019

    I got this error on my Ubuntu(18.04.1 LTS) system for openCV 3.4.2, as the method call to cv2.imshow was failing. I am using anaconda. Just the below 2 steps helped me resolve:

    conda remove opencv
    conda install -c conda-forge opencv=4.1.0
    

    If you are using pip, you can try

    pip install opencv-contrib-python
    
    0 讨论(0)
  • 2020-12-02 09:45

    For my system (Ubuntu 18.04) the following was working.
    First:

    sudo apt-get update -y

    sudo apt-get install -y libgtk2.0-dev

    conda create -n py35 python=3.5

    conda activate py35

    Then configure the environment

    pip install Cython

    pip install scikit-build

    conda install -c anaconda cmake

    pip install dlib

    pip install face_recognition

    pip install imutils

    And finally:

    pip install opencv-contrib-python

    0 讨论(0)
  • 2020-12-02 09:49

    I used pip to install opencv-python. (https://pypi.org/project/opencv-python/)

    1) Remove the opencv package from conda:

    >> conda remove opencv
    

    2) To your env.yml file add this:

    ...
    dependencies:
      - numpy
      - pytest
      ...
      - pip:
        - opencv-python
    
    0 讨论(0)
  • 2020-12-02 09:49

    Remove opencv from anaconda=

    conda remove opencv

    Then, reinstall opencv using pip:

    pip install opencv

    This is working for me.

    0 讨论(0)
  • 2020-12-02 09:56

    Easy with Ubuntu 18.04. It works for me:

    Remove opencv-python:

    pip3 uninstall opencv-python
    

    And then re-install opencv-python:

    pip3 install opencv-python
    

    Issue was resolved.

    0 讨论(0)
提交回复
热议问题