Open In App
Related Articles

Setup OpenCV With PyCharm Environment

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Introduction:

If you love working on image processing and video analysis using python then you have come to the right place. Python is one of the key languages which is used to process videos and images.

Requirements for OpenCV:

  • 32- or a 64-bit computer.
  • Windows, macOS or Linux.
  • Python 2.7, 3.4, 3.5 or 3.6.

PyCharm

PyCharm is a cross-platform IDE used in computer programming specifically for Python. The platform developed by JetBrains is mainly used in code analysis, graphical debugger etc… It supports web development with Django as well as Data Science with Anaconda.

Official Website: https://www.jetbrains.com/pycharm/

OpenCV

OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on pictures or videos. It was initially built by Intel but later managed by Willow Garag, presently it is managed by Itseez. It is a cross-platform library which available for programming languages apart from python.

 

Method 1: Steps to import OpenCV on PyCharm (Using Terminal):

1) Go to the terminal option at the bottom of the IDE window.

 

2) The pip (package manager) can also be used to download and install OpenCV. To install OpenCV, just type the following command:

Python3

pip install opencv-python

                    

3) Now simply import OpenCV in your python program in which you want to use image processing functions.

To check if OpenCV is correctly installed, just run the following program in PyCharm to perform a version check:

Python3

import cv2
print("GeeksForGeeks")
print("Your OpenCV version is: " + cv2.__version__)

                    

Output:

GeeksForGeeks
Your OpenCV version is: 4.4.0

 

Method 2: Steps to install OpenCV on PyCharm (Using Python Packages):

1) Go to the Python Packages option at the bottom of the IDE window.

Python Package Option

2) Search for “opencv-python” and select the option from PyPI. Click on Install Package.

Opencv-python search result

3) The package is installed and is visible in the “Installed” Tab.

Opencv-Python installed

4) To remove the package, click on the package name (here : opencv-python) from the Installed. Click three dots, select “Delete Package”.

Delete opencv-python



Last Updated : 03 Feb, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads