Environment:
This simple code is running fine with no errors; however, no image is produced and nothing is displayed, and I'm forced to manually stop the code and interrupt it to exit, otherwise it just seems to run forever? This exact same code used to work fine on my windows laptop. Any clue? The code:
import cv2
CV_cat = cv2.imread('Cat.jpg')
cv2.imshow('displaymywindows', CV_cat)
cv2.waitKey(1500)
import cv2
CV_cat = cv2.imread('Cat.jpg')
cv2.imshow('displaymywindows', CV_cat)
cv2.waitKey(0) #wait for a keyboard input
cv2.destroyAllWindows()
try this code
With Ubuntu 18.04 and Anaconda environment I was getting the error with Pycharm as
process finished with exit code 139 (interrupted by signal 11 sigsegv)
Solved it by pip install opencv-python-headless
in addition to pip install opencv-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With