Can't see image in Python cv

Question: I’m trying to output an image using cv2.imshow. It doesn’t seem to work cause I can’t see an output or it’s not showing.

Repl link:

import cv2

# Load an image
img = cv2.imread('epic.jpg')

# Display the image
cv2.imshow('Image', img)


Hello @samanthaleigarc and welcome to the community!

The link you provided to your repl lead to a 404 page, are you sure you got the right link or is your repl set to private? You can see how to share your code in the post below:

Edit: I just found your repl


Now, about your problem.

I don’t think Replit supports cv2.imshow… (needs to be confirmed)
You can try use the file viewer to see the file manually. Or instead of displaying images with cv2.imshow, you save them using cv2.imwrite and then view them after that.


You could display the image in a web format using HTML and Python frameworks like Flask or Django.