close

How to install cv2?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to install cv2 in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to install cv2?

  1. How to install cv2?

    For python3 you can simply do pip3 install opencv-python and it will work.

  2. install cv2

    For python3 you can simply do pip3 install opencv-python and it will work.

Method 1

For python3 you can simply do pip3 install opencv-python and it will work.

Method 2

using workon

creating virtual environment

mkvirtualenv -p python3 opencv

Inside the virtual environment. If you are only working with images

pip install opencv-python

opencv-python

If you need support for working videos

pip install opencv-contrib-python

opencv-contrib-python

If you need a non GUI opencv

pip install opencv-python-headless

opencv-python-headless

If you need to install specific version you can use == to check the available version first like

pip install opencv-python== ,then install the version you require

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read