Check version
Check your OpenCV version on Windows
import cv2
print(cv2.__version__)
4.12.0
# Full build info (shows CUDA, modules, etc):
print(cv2.getBuildInformation())
# From command line:
C:\> python -c "import cv2; print(cv2.__version__)"
4.12.0
# Check pip package version:
C:\> pip show opencv-python
Name: opencv-python
Version: 4.12.0.86
Latest version
What is the latest OpenCV version?
| Version | Released | pip package | Status |
|---|---|---|---|
| 4.12.0 | May 2026 | opencv-python==4.12.0.86 | Latest stable |
| 4.11.0 | Jan 2026 | opencv-python==4.11.0.86 | Supported |
| 4.10.0 | Jun 2024 | opencv-python==4.10.0.84 | Supported |
| 4.9.0 | Jan 2024 | opencv-python==4.9.0.80 | Update recommended |
Check the latest release at github.com/opencv/opencv/releases.
Update
Update OpenCV to the latest version
# Update to latest:
C:\> pip install --upgrade opencv-python
Successfully installed opencv-python-4.12.0.86
# Update contrib variant:
C:\> pip install --upgrade opencv-contrib-python
# Pin to specific version:
C:\> pip install opencv-python==4.10.0.84
After updating, test your code: new versions occasionally have API changes. Run
python -c "import cv2; print(cv2.__version__)" to confirm the update.Downgrade
Roll back to an older version
# Downgrade to specific version:
C:\> pip install opencv-python==4.9.0.80
# Check available versions:
C:\> pip index versions opencv-python
Available versions: 4.12.0.86, 4.11.0.86, 4.10.0.84, 4.9.0.80...
FAQ
Version questions
pip upgrade says "already up to date" but newer version exists
The pip cache may be stale. Try:
pip install --upgrade --no-cache-dir opencv-python. Also check you are upgrading in the correct Python environment.After update, code broke with AttributeError
Some APIs changed between versions. Check the OpenCV changelog at github.com/opencv/opencv/wiki/ChangeLog. Common change: ArUco API changed significantly in 4.7+. To revert:
pip install opencv-python==previous.version.How to check OpenCV version in C++?
In C++ use the preprocessor macros:
CV_VERSION (string), CV_MAJOR_VERSION, CV_MINOR_VERSION, CV_SUBMINOR_VERSION. Print with: std::cout << CV_VERSION;