Downloading Tkinter and pyqt5 on BBB

I’m trying to download Tkinter and pyqt5 to my BBB so I can display a GUI on my PC. I’m using the USB cable (Comes with BBB) and an ethernet for downloads. I’ve managed to download Tkinter but when I run a program:
from tkinter import *

I get

ModuleNotFoundError: No module named ‘tkinter’

Here is the list of libraries I have downloaded on BBB.

pip3 list
Package Version


Adafruit-BBIO 1.2.0
Adafruit-Blinka 8.5.0
adafruit-circuitpython-busdevice 5.2.3
adafruit-circuitpython-requests 1.12.8
adafruit-circuitpython-typing 1.8.2
Adafruit-PlatformDetect 3.31.0
Adafruit-PureIO 1.1.9
Click 7.0
colorama 0.3.7
cycler 0.11.0
decorator 4.3.0
distro 1.3.0
Flask 1.0.2
fonttools 4.38.0
itsdangerous 0.24
Jinja2 2.10
kiwisolver 1.4.4
MarkupSafe 1.1.0
matplotlib 3.5.3
numpy 1.21.6
packaging 21.3
pandas 1.3.5
Pillow 9.3.0
pip 22.3
pyctrl 0.4.3
pyftdi 0.54.0
pyparsing 3.0.9
pyserial 3.5
python-dateutil 2.8.2
pytz 2022.5
pyusb 1.2.1
rcpy 0.5.1
scipy 1.1.0
setuptools 40.8.0
six 1.16.0
tk 0.1.0
typing_extensions 4.4.0
Werkzeug 0.14.1
wheel 0.32.3

When I run

pip3 install PyQt5

I get

ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none)

ERROR: No matching distribution found for PyQt5

Do I need to download a certain library for PC-BBB GUI communication? Is there something wrong with my pip package?

Hello,

What does this command show on your output?

apt-cache search pyqt5

Seth

P.S. Please post it here in the logs w/ six back ticks so it is fancy looking. It just makes it easier to read. Contrast!

Oh. You may want to erase all your pip3 installs and use the package manager except for what was already installed. I have had issues in the past w/ not using python3-venv and not making virtual environments available before installing w/ python3 -m pip install -U <your_Package>.

The package manager for Debian has many libs. available that can be almost just the right replacement at times. The package manager and pip3 installs are quite different w/ different commands to install different libs. remotely. Case by case basis, really.

debian@beaglebone:~$ apt-cache search pyqt5

python-pyqt5.qwt-doc - Python Qwt6 technical widget library, documentation and examples

python3-pyqt5.qwt - Python version of the Qwt6 technical widget library (Python3)

pyqt5-dev - Development files for PyQt5

pyqt5-dev-tools - Development tools for PyQt5

pyqt5-examples - Examples and demos for PyQt5

python-dbus.mainloop.pyqt5 - D-Bus Qt main loop support for Python 2

python-dbus.mainloop.pyqt5-dbg - D-Bus Qt main loop support for Python 2 (debug extension)

python-pyqt5 - Python 2 bindings for Qt5

python-pyqt5-dbg - Python 2 bindings for Qt5 (debug extensions)

python-pyqt5.qtmultimedia - Python 2 bindings for Qt5’s Multimedia module

python-pyqt5.qtmultimedia-dbg - Python 2 bindings for Qt5’s Multimedia module (debug extensions)

python-pyqt5.qtopengl - Python 2 bindings for Qt5’s OpenGL module

python-pyqt5.qtopengl-dbg - Python 2 bindings for Qt5’s OpenGL module (debug extension)

python-pyqt5.qtpositioning - Python 2 bindings for QtPositioning module

python-pyqt5.qtpositioning-dbg - Python 2 bindings for QtPositioning module (debug extension)

python-pyqt5.qtquick - Python 2 bindings for QtQuick module

python-pyqt5.qtquick-dbg - Python 2 bindings for QtQuick module (debug extensions)

python-pyqt5.qtsensors - Python 2 bindings for QtSensors module

python-pyqt5.qtsensors-dbg - Python 2 bindings for QtSensors module (debug extension)

python-pyqt5.qtserialport - Python 2 bindings for QtSerialPort module

python-pyqt5.qtserialport-dbg - Python 2 bindings for QtSerialPort module (debug extension)

python-pyqt5.qtsql - Python 2 bindings for Qt5’s SQL module

python-pyqt5.qtsql-dbg - Python 2 bindings for Qt5’s SQL module (debug extension)

python-pyqt5.qtsvg - Python 2 bindings for Qt5’s SVG module

python-pyqt5.qtsvg-dbg - Python 2 bindings for Qt5’s SVG module (debug extension)

python-pyqt5.qtwebchannel - Python 2 bindings for Qt5’s WebChannel module

python-pyqt5.qtwebchannel-dbg - Python 2 bindings for Qt5’s Webchannel module (debug extension)

python-pyqt5.qtwebengine - Python 2 bindings for Qt5’s WebEngine module

python-pyqt5.qtwebengine-dbg - Python 2 bindings for Qt5’s WebEngine module (debug extensions)

python-pyqt5.qtwebkit - Python 2 bindings for Qt5’s WebKit module

python-pyqt5.qtwebkit-dbg - Python 2 bindings for Qt5’s WebKit module (debug extensions)

python-pyqt5.qtwebsockets - Python 2 bindings for Qt5’s WebSockets module

python-pyqt5.qtwebsockets-dbg - Python 2 bindings for Qt5’s WebSockets module (debug extension)

python-pyqt5.qtx11extras - Python 2 bindings for QtX11Extras module

python-pyqt5.qtx11extras-dbg - Python 2 bindings for QtX11Extras module (debug extension)

python-pyqt5.qtxmlpatterns - Python 2 bindings for Qt5’s XmlPatterns module

python-pyqt5.qtxmlpatterns-dbg - Python 2 bindings for Qt5’s XmlPatterns module (debug extension)

python3-dbus.mainloop.pyqt5 - D-Bus Qt main loop support for Python 3

python3-dbus.mainloop.pyqt5-dbg - D-Bus Qt main loop support for Python 3 (debug extension)

python3-pyqt5 - Python 3 bindings for Qt5

python3-pyqt5-dbg - Python 3 bindings for Qt5 (debug extensions)

python3-pyqt5.qtmultimedia - Python 3 bindings for Qt5’s Multimedia module

python3-pyqt5.qtmultimedia-dbg - Python 3 bindings for Qt5’s Multimedia module (debug extensions)

python3-pyqt5.qtopengl - Python 3 bindings for Qt5’s OpenGL module

python3-pyqt5.qtopengl-dbg - Python 3 bindings for Qt5’s OpenGL module (debug extension)

python3-pyqt5.qtpositioning - Python 3 bindings for QtPositioning module

python3-pyqt5.qtpositioning-dbg - Python 3 bindings for QtPositioning module (debug extension)

python3-pyqt5.qtquick - Python 3 bindings for QtQuick module

python3-pyqt5.qtquick-dbg - Python 3 bindings for QtQuick module (debug extension)

python3-pyqt5.qtsensors - Python 3 bindings for QtSensors module

python3-pyqt5.qtsensors-dbg - Python 3 bindings for QtSensors module (debug extension)

python3-pyqt5.qtserialport - Python 3 bindings for QtSerialPort module

python3-pyqt5.qtserialport-dbg - Python 3 bindings for QtSerialPort module (debug extension)

python3-pyqt5.qtsql - Python 3 bindings for Qt5’s SQL module

python3-pyqt5.qtsql-dbg - Python 3 bindings for Qt5’s SQL module (debug extension)

python3-pyqt5.qtsvg - Python 3 bindings for Qt5’s SVG module

python3-pyqt5.qtsvg-dbg - Python 3 bindings for Qt5’s SVG module (debug extension)

python3-pyqt5.qtwebchannel - Python 3 bindings for Qt5’s WebChannel module

python3-pyqt5.qtwebchannel-dbg - Python 3 bindings for Qt5’s Webchannel module (debug extension)

python3-pyqt5.qtwebengine - Python 3 bindings for Qt5’s WebEngine module

python3-pyqt5.qtwebengine-dbg - Python 3 bindings for Qt5’s WebEngine module (debug extensions)

python3-pyqt5.qtwebkit - Python 3 bindings for Qt5’s WebKit module

python3-pyqt5.qtwebkit-dbg - Python 3 bindings for Qt5’s WebKit module (debug extensions)

python3-pyqt5.qtwebsockets - Python 3 bindings for Qt5’s WebSockets module

python3-pyqt5.qtwebsockets-dbg - Python 3 bindings for Qt5’s WebSockets module (debug extensions)

python3-pyqt5.qtx11extras - Python 3 bindings for QtX11Extras module

python3-pyqt5.qtx11extras-dbg - Python 3 bindings for QtX11Extras module (debug extension)

python3-pyqt5.qtxmlpatterns - Python 3 bindings for Qt5’s XmlPatterns module

python3-pyqt5.qtxmlpatterns-dbg - Python 3 bindings for Qt5’s XmlPatterns module (debug extension)

pyqt5chart-dev - Development files for PyQtCharts

python3-pyqt5.qtchart - Python 3 bindings for Qt5’s Charts module

python3-pyqt5.qtchart-dbg - Python 3 bindings for Qt5’s Charts module (debug extension)

python-qtpy - abtraction layer for PySide/PyQt4/PyQt5 (Python 2)

python3-qtpy - abtraction layer for PySide/PyQt4/PyQt5 (Python 3)

pyqt5.qsci-dev - Development files for Python Qscintilla2 (Qt5)

python-pyqt5.qsci - Python bindings for QScintilla 2 with Qt 5

python-pyqt5.qsci-dbg - Python bindings for QScintilla 2 (Qt 5 debug extensions)

python3-pyqt5.qsci - Python 3 bindings for QScintilla 2 with Qt 5

python3-pyqt5.qsci-dbg - Python 3 bindings for QScintilla 2 (Qt 5 debug extensions)

qutebrowser - Keyboard-driven, vim-like browser based on PyQt5

1 Like

Well There @Jamboy ,

You have plenty! Enjoy!

Seth

P.S. Debian -- Details of package python3-pyqt5 in bullseye and Debian -- Details of package python3-tk in bullseye .

Hello @Jamboy ,

Seth here. Did it work yet? I mean…were you able to install the required libs. and then use them accordingly?

Seth

P.S. If the python3-pyqt5 lib. needs special permissions, which it should not, you can always check w/ this page online but your groups for the user debian should have all the permissions you need: How to audit permissions with the find command .

Update - I tried pip3 in the virtual environment and it didn’t work. I uninstalled pip3 and reinstalled it and it didn’t work. These were the commands and outputs.

pip uninstall pip

Found existing installation: pip 22.3
Uninstalling pip-22.3:
Would remove:
/home/debian/.local/bin/pip
/home/debian/.local/bin/pip3
/home/debian/.local/bin/pip3.10
/home/debian/.local/bin/pip3.7
/home/debian/.local/lib/python3.7/site-packages/pip-22.3.dist-info/*
/home/debian/.local/lib/python3.7/site-packages/pip/*
Proceed (Y/n)? y
Successfully uninstalled pip-22.3

sudo apt install python3-pip

Reading package lists… Done
Building dependency tree
Reading state information… Done
python3-pip is already the newest version (18.1-5).

After I tried to install pyqt5 with this command.

pip3 install pyqt5

and it returned this error

FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/pip-install-0im1h0vt/pyqt5/setup.py’

I’m not familiar with package managers (I’ve mostly used pip for downloads). I’ll have to look into it.

No, not yet. I’m a little confused by what the apt-cache search command printed. Also which of the libraries I will need for PyQt5. Was the search on the BBB or on the web?

Also, I saw you posted a link for PyQt5 at package.org. Can I use the get command to download that directly?

Hello @Jamboy ,

Seth here again…

sudo apt install python3-tk python3-pyqt5

Seth

P.S. That will install some form of those libs. Now, the versioning will be different if you try to install them via pip3 or via a compilation.

Hello @Jamboy ,

Seth here again! Anyway, um, the link(s) I posted was for the packages.debian.org site online where they host info. about their apt package manager installs and dependencies.

I thought python3 -m pip was used now instead and in favor of pip3? Anyway, maybe I am behind the times.

Either way, apt works and installs the libs. in a handy, little file where your user, most likely debian, can use them easily and w/out error.

Seth

P.S. W/ pip3 or python3 -m pip, the installs need to be made specifically in a way so that things work out properly, e.g. using the -U option or other forms of the install ideas via pip3/python3 -m pip.

Hello Seth,
I ran the command and the download was successful. I tried a test file for pyqt5 and tkinter and they both returned errors with the display.

python3 qt5test.py

qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

qt5test.py

from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
app = QApplication([])
window = QWidget()
layout = QVBoxLayout()
layout.addWidget(QPushButton(‘Top’))
layout.addWidget(QPushButton(‘Bottom’))
window.setLayout(layout)
window.show()
app.exec()

Would one of the libraries in the cache run the display on my PC? Or do I need something else?

Hello,

I think running graphics from an embedded SBC like the beaglebone black or other am335x devices are not the same as running a server and promoting files.

For instance, I think testing the server with a program like tightvncserver on the BBB and RealVNC viewer on the development host could be beneficial at first glance.

I am not far into graphics for now but I have run servers from the www on the BBB to a host to test capabilities and applications. It is better to handle things from the LCD at times.

Anyway, what I am describing will allow you to test your applications before running them as graphics.

Seth

P.S. I just got what you typed. Sorry for my tangent. Oh! I know this seems mundane but…

qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

Try googling that error as is…w/out spaces, quotations, or any other text. It seems, please hold. I will check. So, it seems others have had some trouble w/ this idea…

I think not installing x11 is okay but you may need it instead of using wayland like w/ what is prepackaged… Do not quote me, i.e. as I have not tested this myself currently.

Hello @Jamboy ,

First and foremost, I need to collect some info. from you.

  1. uname -a
  2. cat /etc/dogtag

Those two commands will help me better understand what you are using in your programming env. to create applications w/ pyqt5.

Number 1. should return your kernel from beagleboard.org. Number 2. should report back the output of image being used.

Seth

P.S. I do not really have more time tonight, i.e. it is late. Anyway, send in those two commands only. I can then test the application you provided in the highlighted text on my end to see if I can make it work.

Also, are you using a Cape or random LCD Screen and w/ or w/out a x-windows-manager? Not wayland but anything? Use this command to search for it: echo $XDG_SESSION_TYPE

Also…I found that command by searching the above mentioned highlighted text from your error on whatever you are viewing. If you provide any of this info, I can better help you. This is where I found the info. to test the X-Window-System on the BBB: qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. | Qt Forum .

Hey @Seth

Here’s the information from my BBB

uname -a

Linux beaglebone 4.19.94-ti-r73 #1buster SMP PREEMPT Fri Apr 15 21:38:30 UTC 2022 armv7l GNU/Linux

debian@beaglebone:~$ cat/etc/dogtag

-bash: cat/etc/dogtag: No such file or directory

debian@beaglebone:~$ echo $XDG_SESSION_TYPE

tty

I did download an image to the BBB so I’m not sure why no file came up. I’m trying to have the pyqt’s window appear on my PC (Mac) screen.

Hello,

cat /etc/dogtag is a command and the space is needed in between the cat and /etc/dogtag.

Okay about installing the image. So, you need a windows manager. Have you installed gnome, xfce4, or another GUI OS on top of the image server you installed from beagleboard.org?

Seth

P.S. I do not use Mac but using any OS will provide you w/ a way to install, run, and handle the BBB w/ a OS or server format. The reason I typed the idea(s) earlier about the tightvncserver and VNC Viewers is that you can test you application w/out the need to start a .service file or other server service.

Hello,

Sorry about the delay. I’ve been trying to get more memory on my beaglebone black. It says I only have 14MB of storage when it should be 4GB.

Here’s the command.

cat /etc/dogtag

BeagleBoard.org Debian Buster IoT Image 2022-10-10

Oh…

@Jamboy … I think I see an issue but do not quote me. How many different images have you tried?

Also, the reboot should automatically update what was once the script to grow the partition to its regular size.

But…you are using Buster. Try:

  1. cd /opt/script/
  2. git pull
  3. cd tools
  4. ./grow_partition.sh ?

I do not use Buster any longer for some reason. I have moved on “emotionally” from the trials of Buster (I think).

I can never be sure, i.e. as I know one board I use may have Buster still on it.

Seth

P.S. There are some updated Bullseye images. I just do not want you to lose your work that you have completed on your BBB. So, maybe try the older script after backing up your data and see if the inflation of the SD Card or eMMC works. Then, you can add additional libs. to your BBB w/out cause for error.

Also, I was unaware of Buster having a new image from the beagleboard.org. I must be missing something at some level.

Hahah, how bad is Buster? I asked for help and someone sent me the image.

I flashed this image a few times when I started but it was the only one on my board. I haven’t done too much work on this BBB so if I have to flash a new image I’d rather do it now then later.

Here is the input and output from the code. (It asked for root access)

debian@beaglebone:/opt/scripts/tools$ sudo ./grow_partition.sh

[sudo] password for debian:

Media: [/dev/mmcblk1]

sfdisk: 2.26.x or greater

Disk /dev/mmcblk1: 3.5 GiB, 3791650816 bytes, 7405568 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x8d0dc814

Old situation:

Device Boot Start End Sectors Size Id Type

/dev/mmcblk1p1 * 8192 7405567 7397376 3.5G 83 Linux

Created a new DOS disklabel with disk identifier 0x2035b4bf.

/dev/mmcblk1p1: Created a new partition 1 of type ‘Linux’ and of size 3.5 GiB.

Partition #1 contains a ext4 signature.

/dev/mmcblk1p2: Done.

New situation:

Disklabel type: dos

Disk identifier: 0x2035b4bf

Device Boot Start End Sectors Size Id Type

/dev/mmcblk1p1 * 8192 7405567 7397376 3.5G 83 Linux

The partition table has been altered.

Calling ioctl() to re-read partition table.

Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

Syncing disks.

reboot

1 Like

I am not as handy w/ kernel debugging as I am w/ moving on emotionally.

W/ that said out loud and in public, I say search this forum for Bullseye and you will find a number of different images w/ different kernels used specifically for the am335x on the BBB.

Seth

P.S. Now! w/ apt in general handling updates of kernel patches and full upgrades, it is pretty neat!

Hi @Seth,

I’ve been trying different images with Bullseye. I’ve tried with the debian recommended images
https://debian.beagle.cc/images/bbai64-debian-11.3-xfce-arm64-2022-06-14-10gb.img.xz

and the flasher debian image off the latest images website.

https://debian.beagle.cc/images/bbai64-emmc-flasher-debian-11.3-xfce-arm64-2022-06-14-10gb.img.xz

I didn’t have a problem writing them to the micro SD card using Etcher but when I tried to flash the BBB none of the lights came on. I held the S2 button, I reset it a few times. I’m wondering if I should erase the board’s memory in Disk Utility to get rid of the old image but I’m not sure if that will damage my BBB.

Do you have any suggestions?

Hello @Jamboy ,

Seth here. On this forum is the correct debian images for the BBB.

Seth

P.S. Try to search for Bullseye. It is the am335x boards that are for the BBB and not the aarch64 images.