Skip to content
← Back to Community
How To Import CV2
Profile icon
[deleted]

Does anyone know how to import cv2 into Python on repl.it? I can’t find any module named cv, cv2, or opencv-python, and creating a requirements.txt file shows an error.

Is there any way to do this?

Answered by PattanAhmed [earned 5 cycles]
View Answer
Voters
Profile icon
alejandra-yonet
Profile icon
20YapJ
Profile icon
sandeepa7
Profile icon
trinhxuankien
Comments
hotnewtop
Profile icon
PattanAhmed

@LoveTheBears1O1 Hi,
To import, use this command
Code:-

import opencv-python

That's it.
Thanks!

Hope this helps

Profile icon
gbilodeau

import opencv-python
doesn't work for mr it generates a syntax error objecting to the hyphen.
the module opencv-python has been added.

Profile icon
CodingCactus

I have moved this to the ask board as it is a question and not a jam submission.

Profile icon
hg0428

This is not the right section to put a question like this. Put it in the ask section. Why did you put it in the jam section?

Profile icon
[deleted]

@hg0428 This is in the ask section.

Profile icon
hg0428
Profile icon
[deleted]

@hg0428 oh oops i must have clicked the wrong category! Thanks for moving it @CodingCactus

Profile icon
[deleted]

EDIT: import opencv-python worked :)

Profile icon
MatomeHsu

it doesn't work for me :(

Profile icon
nurziknurz

how did you fix it?