How to install any Python-GUI on Linux for Colibri VFxx?


I installed Python 3 by command opkg install python3, after that I installed Python3 Tkinter by command opkg install python3-tkinter, but if I use import tkinter from python it gives an error, that Python may not be configured for Tk, see pic.1:


The same situation with older version of Python 2.7.12, see pic.2:


I don’t know how to configure Tcl/Tk for enable tkinter. I would like to try it for use GUI under Python. Have you any ideas? Maybe you have other ready-to-use GUI-framefork for Python, running on this kind of Linux?

Both, Python 2 and 3 are by default configured without tkinter support. Toradex added a build time configuration support with a bbappend to the python 2 recipe. You can enable tkinter support by using a PACKAGECONFIG in your local.conf:

PACKAGECONFIG_pn-python = "tkinter"

Then rebuild the iamge, see also OpenEmbedded (core).

Note: It seems that there have been discussions on the OpenEmbedded mailing list about integrating tkinter support upstream (e.g. here or here), but until now it seems that upstream Python OE recipes do not provide tkinter support.

Thanks for answer.

I added the line PACKAGECONFIG_pn-python = "tkinter" as a last line to local.conf.
After that I made following steps:

 1. repo sync
 2. . export
 3. bitbake -c clean angstrom-lxde-image
 4. repo sync
 5. . export
 6. bitbake -k angstrom-lxde-image

But unfortunately, after opkg install python (only 2.7) and opkg install python-tkinter I still have the same error - Python may not be configured for Tk.

What I am doing wrong?

The feeds are on public servers and hence not influenced from your operations…

You can ask bitbake to include Python into the image by adding the following line to conf/local.conf

IMAGE_INSTALL_append = " python python-tkinter"

One possibility is to use a GTK-based GUI application using the PyGObject provided with Python bindings. To do this, add it to the local.conf file

IMAGE_INSTALL_append = " python-imaging python-pygobject cairo" 

And just implement your GUI. Use GLADE to design your interface, it is very similar to Qt designer


Thanks for your Input.

Best regards,