What this error looks like
When this error includes opencv_iconv.dll or cv2.pyd in the message, it means Windows cannot load a required DLL that OpenCV depends on. The most common cause is a missing or incompatible Visual C++ Redistributable.
Install Visual C++ Redistributable
OpenCV requires the Microsoft Visual C++ Redistributable to be installed. Download and install vc_redist.x64.exe for 64-bit Python:
- 1
Download vc_redist.x64.exe
Get it from aka.ms/vs/17/release/vc_redist.x64.exe (Visual Studio 2022 redistributable).
- 2
Run the installer
Double-click
vc_redist.x64.exeand click Install. If it says "already installed", click Repair. - 3
Reinstall OpenCV
C:\> pip uninstall opencv-python -yC:\> pip install opencv-python --force-reinstall - 4
Test the import
>>> import cv2>>> print(cv2.__version__)4.12.0
Architecture mismatch (32-bit vs 64-bit)
OpenCV pip wheels are 64-bit only. If you have 32-bit Python, you will get this error with no fix other than switching to 64-bit Python.
Wrong or conflicting OpenCV packages
If you have both opencv-python and opencv-contrib-python installed, they conflict. Remove all and reinstall one:
Use Dependencies tool to find the missing DLL
For advanced diagnosis, use the free Dependencies tool to see exactly which DLL is missing:
- Download Dependencies from GitHub
- Open the tool and drag your
cv2.pydfile into it (find it insite-packages/cv2/) - Look for red entries — these are the missing DLLs
- Install the package that provides each missing DLL (usually VC++ Redistributable or CUDA runtime)
DLL error questions
VC++ Redistributable is already installed but error persists
vc_redist.x64.exe again and choose Repair. Then restart your PC and reinstall OpenCV. Sometimes the runtime needs a fresh copy even if it appears installed.Error only in PyCharm or VS Code, not in Command Prompt
After Windows update the error came back
vc_redist.x64.exe and then pip install opencv-python --force-reinstall.