ModuleNotFoundError: No module named cv2: install OpenCV in the right Python

The package is called opencv-python, but you import it as cv2. Install it with the same Python that runs your script.

What the message means

Several Pythons can live on one computer. A package installed for one is not visible to the other.

Fix it in this order

  1. Run python -m pip install opencv-python using the exact Python you use to run the script.
  2. Activate your virtual environment first if you use one.
  3. Check which Python runs with python –version and where pip installs.
  4. Select the same interpreter in your editor.
  5. Do not install several OpenCV packages at once, since they conflict.

If you see this, do this

You seeDo this
Installed but still missingDifferent Python.
Import crashes after installing two packagesRemove all and install one.

cannot open camera, camera calibration.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.