Ubuntu, how to install OpenCV for python3?

前端 未结 8 1879
谎友^
谎友^ 2020-12-13 14:51

I want to install OpenCV for python3 in ubuntu 16.04. Fist I tried running sudo apt-get install python3-opencv which is how I pretty much install all of my pyt

8条回答
  •  半阙折子戏
    2020-12-13 15:28

    Using conda inside a python3 environment:

    First install conda in a python3 environment and activate it if you haven't yet:

    conda create --name py3k python=3
    source activate py3k
    

    Now you can install opencv in the conda environment:

    pip install pillow
    conda install -c menpo opencv3=3.1.0
    

    To import in Python:

    import cv2
    

提交回复
热议问题