In pip
package management, there are 4 different OpenCV packages all using the same namespace, cv2
. Although they are not officially supported by OpenCV.org, they are commonly used in developers' community. You could install any of them using the following command:
pip install PACKAGE_NAME
where PACKAGE_NAME
can be
opencv-python
(only contains main modules)
opencv-contrib-python
(contains both main and contrib modules)
opencv-python-headless
(same as opencv-python
but without GUI functionality)
opencv-contrib-python-headless
(same as opencv-contrib-python
but without GUI functionality)
You should only install one of them depending on your needs. If you accidentally installed multiple of them in the same environment, you can remove them using pip uninstall
before installing the correct one again.
For more details, you can refer to the project description of OpenCV on Wheels.
As of 2021, all of these 4 packages are official OpenCV projects. Source: OpenCV Website.