# Gtk-WARNING \*\*: cannot open display on Raspberry Pi 3 with OpenCV

**URL:** <https://forums.balena.io/t/gtk-warning-cannot-open-display-on-raspberry-pi-3-with-opencv/2568>\
**Category:** Product support\
**Tags:** raspberrypi3, docker\
**Created:** [February 14, 2018, 3:18pm UTC](https://forums.balena.io/t/gtk-warning-cannot-open-display-on-raspberry-pi-3-with-opencv/2568 "2018-02-14T15:18:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siliconapp](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@siliconapp](https://forums.balena.io/u/siliconapp)\
**Post date:** [February 14, 2018, 3:18pm UTC](https://forums.balena.io/t/gtk-warning-cannot-open-display-on-raspberry-pi-3-with-opencv/2568/1 "2018-02-14T15:18:44Z")

</div>

Hello,

As the title suggests, I’m getting a Gtk-WARNING \*\*: cannot open display: :0 error when trying to run an OpenCV application in a resin/raspberrypi3-python:3.6 Docker.

I checked the camera module using raspistill and it works, but OpenCV wouldn’t. I’ve tried to set the DISPLAY environment value to :0 and :1 but it didn’t help.

Googling tells me that this has something to do with X11Forwarding and/or not being the “pi” user when running the application.

I’m trying to run the test\_video.py from [https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/](https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/)
