In my local machine with macOS Mojave, I installed a virtual environment with Python 3.6, opencv package and some additional unrelated packages.
I started a very simple Jupyter Notebook that is executed with no problem, here it's the code:
import cv2
print(cv2.__version__)
my_img = cv2.imread("colibri_763_460.jpeg",1)
cv2.imshow("Original", my_img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Now, I'm trying to execute the same code in a Jupyter Notebook in my remote Ubuntu machine but I can't make it work. These are the steps that I took:
- I copied the image file and the Notebook ypnb file to the remote ubuntu machine.
- I opened an ssh session, selected a virtualenv with the same packages than my local machine and executed the "jupyter notebook"
- I opened another terminal with ssh -L 8000:localhost:8888 mpastorg@mpgubu18 for the ssh tunneling
- I opened my local browser in the localhost:8000 to execute the Notebooks that I have in my remote Ubuntu machine, it works with any Notebook not involving opencv.
I tried to solve my problem using two different ways:
- Installing in the ubuntu remote machine the package opencv-contrib-python-headless: when I try to use cv2.imshow, I got the error method not found
- Installing in the ubuntu remote machine the package opencv-contrib-python: I got the error that kernel is dead.
Does anyone know if there's any way to execute the remote jupyter notebook and see the picture locally? it maybe would be possible a workaround to embed the picture in the browser window?
Thank you very much Marcos Pastor