i'm using raspbian Jessie on the raspberry PI3, when I try to run my code, that is a GUI written in Python, it gives me this error:
erle@erle-brain:~ $ sudo python provaGUI.py
Traceback (most recent call last):
File "provaGUI.py", line 8, in <module>
finestra = Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1813, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "hostname:0"
I already installed XQuarz on my macbook pro (High Sierra 10.13.1). Then I installed these packages on the raspberry:
sudo apt-get --no-install-recommends install xserver-xorg xserver-xorg-video-fbdev xinit pciutils xinput xfonts-100dpi xfonts-75dpi xfonts-scalable
but the error persist.
I read on the raspberry forum that :
1)I need to start up in GUI mode after reboot (but I don't know how I can do it)
2)I need to enter the GUI mode under the same login as the ssh connection (I don't know how to do it with command line)
3) the you need to execute at the ssh connection: export DISPLAY=:0.0
when I write startx on the raspberry this is the ouput but I don't know how to proceed:
erle@erle-brain:~ $ sudo startx
X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
Current Operating System: Linux erle-brain 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=tty1,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Build Date: 11 November 2016 11:59:59AM
xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support)
Current version of pixman: 0.33.3
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Dec 3 18:08:15 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Any advice for this problem??