. Advertisement .
. Advertisement .
The rapid development of the internet goes along with the increase of available Python IDEs on it. Accordingly, Anaconda is known as one of the most widely-used Python IDEs by Python and R Programming programmers in the world. There are various packages and plugins contained by Anaconda such as OpenCV, Pandas, NumPy, etc.
OpenCV stands for Open Source Computer Vision Library, which is a programming functions library. Fundamentally, OpenCV focused on the vision of real-time computers. Also, OpenCV is a multi-platform library, which refers that users can access it in various programming languages such as C++. Python, etc.
In this post, we will give you specific guidance on how to install cv2 on Conda. If you are an Anaconda user, do not skip the useful tutorials below.
How to install cv2 on Conda
1. Install OpenCV by Using the Command pip
The first suggestion for you to install cv2 in Conda is using the command pip to install OpenCV through the terminal of command. pip is system management for a package that could be used for managing and installing all the libraries of software as well as available packages for Python users.
You can install the module OpenCV with the command running below.
pip install opencv-python
This method will be also appropriate for those who are working with the applications on Anaconda.
2. Install OpenCV by Using the Command conda
Note that this command only works for any programmers in Anaconda IDE. To install cv2 on Conda, you can run the following command.
conda install opencv
Sometimes, you probably cannot access the latest module version within the Conda default channel. In this case, conda-forge is utilized to resolve this problem. Essentially, the conda-forge reflects an exertion of a wide community that tries to provide lacking packages or modules in the new version from default channels.
You can utilize conda-forge for installing the module openCV by performing the below command.
conda install -c conda-forge opencv
3. Install OpenCV by Using the Navigator in Anaconda
Alternatively, you can utilize the graphical interface of the navigator in Anaconda for installing OpenCV. After Environments are navigated, choose the environment as required or the base to install. Then, choose the packages option of Not Installed and seek the module or type in the search bar of OpenCV to search packages. If OpenCV installation does not happen, it can be found on this list so you can install it easily.
Besides that, you can follow the below code to confirm whether OpenCV is imported successfully by Anaconda.
import cv2 print cv2.__version__
If there are not any errors arising when importing the package and the output is displayed by the version correctly, then you know that you installed OpenCV successfully. Hopefully, you can easily understand the methods to install cv2 on Conda explained in this post. Each method will be appropriate for certain Python IDEs so you should acknowledge their applicability. Besides that, our website is providing various IT solutions, explore it for more useful coding tutorials.