Uninstall guide

Uninstall OpenCV on Windows — Python, C++ & vcpkg guide

Remove OpenCV completely from Windows. pip uninstall for Python packages, delete the C++ pre-built folder and PATH entry, or use vcpkg remove.

Uninstalling OpenCV is different for Python (pip) vs C++ (delete folder). Follow the section that matches your setup.

Uninstall OpenCV from Python

cmd.exe
# 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'

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

    PowerShell — Administrator
    # 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\bin entry → OK.

  • 3

    Remove from Visual Studio projects

    In each Visual Studio project that used OpenCV: remove the include directory, lib directory and opencv_world4120.lib from Additional Dependencies.

Uninstall OpenCV installed via vcpkg

PowerShell
PS> .\vcpkg\vcpkg.exe remove opencv4:x64-windows
Removing opencv4...

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.

Want to reinstall a clean version?

Fresh install guide for Python with pip.

Python install guide