Uninstalling OpenCV is different for Python (pip) vs C++ (delete folder). Follow the section that matches your setup.
Python / pip
Uninstall OpenCV from Python
# Check what is installed:
C:\> pip show opencv-python
Name: opencv-python Version: 4.12.0.86
# Uninstall standard package:
C:\> pip uninstall opencv-python -y
Successfully uninstalled opencv-python-4.12.0.86
# Remove ALL opencv variants at once:
C:\> pip uninstall opencv-python opencv-contrib-python opencv-python-headless opencv-contrib-python-headless -y
# Verify removal:
C:\> python -c "import cv2"
ModuleNotFoundError: No module named 'cv2'
C++ pre-built binary
Remove the OpenCV C++ installation
The pre-built Windows binary is just a self-extracted folder — there is no installer or uninstaller. To remove it:
- 1
Delete the opencv folder
# Delete the entire opencv folder:PS> Remove-Item -Recurse -Force "C:\opencv" - 2
Remove from PATH
Settings → System → Advanced system settings → Environment Variables → System Path → Edit → find and delete the
C:\opencv\build\x64\vc16\binentry → OK. - 3
Remove from Visual Studio projects
In each Visual Studio project that used OpenCV: remove the include directory, lib directory and
opencv_world4120.libfrom Additional Dependencies.
vcpkg
Uninstall OpenCV installed via vcpkg
PS> .\vcpkg\vcpkg.exe remove opencv4:x64-windows
Removing opencv4...
FAQ
Uninstall questions
pip uninstall succeeds but import cv2 still works
You have multiple Python installations and the other one still has OpenCV. Run
where python to see all Python installations. Uninstall from each: C:\OtherPython\python.exe -m pip uninstall opencv-python -y.How to uninstall OpenCV from a conda environment?
conda remove -n env_name opencv where env_name is your environment name. Or activate the environment first and run conda remove opencv. If installed via pip inside conda, use pip uninstall opencv-python.After uninstalling, other packages that depend on cv2 break
Some packages list OpenCV as a dependency and will reinstall it automatically when you run them. To keep OpenCV uninstalled, check which package brings it back with
pip show package-name and look at its requirements.