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
- Run python -m pip install opencv-python using the exact Python you use to run the script.
- Activate your virtual environment first if you use one.
- Check which Python runs with python –version and where pip installs.
- Select the same interpreter in your editor.
- Do not install several OpenCV packages at once, since they conflict.
If you see this, do this
| You see | Do this |
|---|---|
| Installed but still missing | Different Python. |
| Import crashes after installing two packages | Remove all and install one. |
Related
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.