Skip to content
← Back to Community
How to install cv2 package
Profile icon
NikhilWagh96

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:
Repl.it: package installation failure

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

How to solve this issue?

Voters
Profile icon
Minglun
Profile icon
khushboojain
Profile icon
Identity-Unknown
Profile icon
SourGrape1024
Profile icon
hs21423
Profile icon
DavidShen2
Profile icon
shunchinchin
Profile icon
PragunSrivasta1
Profile icon
avathecutepoodl
Profile icon
yskov
Comments
hotnewtop
Profile icon
ndg63276

Try opencv-python?

Profile icon
Identity-Unknown

same!

Profile icon
HoodieDX

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
SAMUELSHELLEY

@HoodieDX
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: libGL.so.1: 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.