Skip to content
How to install cv2 package
Profile icon

I want to use python-opencv package, I also added it from the Packages to my requirements.txt. But when I run the code it shows me this error: package installation failure

Traceback (most recent call last):
File "python", line 1, in
ModuleNotFoundError: No module named 'cv2'

How to solve this issue?

You are viewing a single comment. View All
Profile icon

I use VSCode, but one time it worked on replit. Go to your shell and type "pip install opencv-python" And then type "import cv2" It should work. Who knows though because replit is updating regularly, and things are subject to change

Profile icon

no good, it accepts the fact that there's a module with the name cv2, but its saying that the file or directory of the module doesn't exist: ImportError: cannot open shared object file: No such file or directory. Other people seem to be having the same problem, but not many seem to know how to fix it. I don't know what to do.