Trouble with GUItracer on Raspberry Pi 3B+

I am doing the exercises from the book entitled Beginning Artifical Intelligence with Raspberry Pi by Donald J. Norris. In one of the exercises he has one using swipl to create a program whereby workers and their managers are identified, then when querying for who is the the employee’s manager, one can watch as swipl goes thru the motions to figure it out (using trace). But, when I do it using guitrace, I get the error: “You must be running the X11 Windows environment. If you are, check the settings of your DISPLAY environment variable as well as the access rights to your X11 server.” So I did some searching on the web, and turns out I needed to install the X11 server by typing the command: “sudo apt install xserver -xorg xinit”. Then another command “sudo dpkg-reconfigure x11-common”. When I type the second command I got: “warning: start and stop action are no longer supported; falling back to defaults.”

What does this mean? What can I do to fix this problem? I think the GUItracer will benefit me more than the non-GUI tracer because then I can see the “neural network” used to determine the answer to a query.

Sorry to say this but unless someone here knows how to fix the X11 error based on the OS (which I guess is based on Ubuntu) then you will probably not be getting a response.

I do use SWI-Prolog and do have a Raspberry Pi but have yet to install SWI-Prolog on my Pi. One of these years. :woozy_face:

Odds are that others following along in the book will have the same problem, so see if the author can help. If not then try following along in the book using SWISH instead of the Pi.

Thanks EricGT. I think you’re right, I should try the author of the book. I will do that today.

Ah, X11 … the 2nd worst windowing system ever invented. (I’ll leave you to guess what’s the worst and what might have been the best.)

The first question is: what have you set DISPLAY to? The typical result is:

$ echo $DISPLAY

If it’s blank, then try this:

export DISPLAY=:0

(xterm might not be installed on your system; you can probably get it by sudo apt install xterm. Another package that can help is x11-apps, which includes xeyes, which you can use to test your mouse.)

The good news with X11 is that you can use it to display on a remote system, assuming you can ssh to your Raspberry Pi. Look at the -X and -Y options to ssh.

Thanks Peter. I will try that out. For the time being, I decided to skip that part in the book. I’ll try downloading xterm and X11 -apps. For the first worst windowing system…was it Windows? :grin:

Yes – Windows has most of the disadvantages of X11 without its advantages, such as being useable remotely over a TCP connection (or ssh tunnel) or being able to easily integrate multiple input sources (e.g., responding to both mouse/keyboard and a separate TCP socket). Although I’m sure there are less well-known windowing systems that are even worse than Windows. (It’s been many years since I’ve programmed Windows (or X11), but my recollection is that the Windows API and Motif API were about equally horrible; and X11 required very careful reading of the docs to avoid memory leaks because of inconsistencies in the API conventions).