Workaround for PiCockpit on Ubuntu
Note: this is a work in progress, another problem has cropped up which needs to be looked at! Currently PiCockpit will not work on Ubuntu, unfortunately.
A user tried to install PiCockpit on Ubuntu for Raspberry Pi, and contacted me with the following problem:
Setting up picockpit-client (2.0.1) …
cp: cannot stat ‘/usr/bin/python3.7‘: No such file or directory
cp: cannot stat ‘/usr/bin/python3.7’: No such file or directory
WARNING: Some error occured while updating
/usr/share/picockpit-client/bin/python3
picockpit-client.service is a disabled or a static unit, not starting it.
Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named ‘encodings’
Current thread 0xb6ef8970 (most recent call first):
bash: line 15: 28213 Aborted sudo picockpit-client connect –yes
This problem is due to the fact that the Picockpit client depends on Python version 3.7.
Ubuntu 20.04.1 LTS has Python version 3.8.
You can try to work around this problem, before re-running the installation for picockpit-client, by running the following command:
sudo ln -s /usr/bin/python3.8 /usr/bin/python3.7
Note that this is a rather “dirty” workaround, as it will suggest to applications that a newer Python version is actually an older version. It seems a bit challenging currently to change the way the Debian and the Raspberry Pi OS package is built, I will investigate further if more users inquire about PiCockpit not working on Ubuntu.
Possibly there will be a separate package.
Possibly I will also include an option for the symlink in the setup.sh script.
After executing the command above, you can install PiCockpit using the one-liner:
bash -c "$(curl -k -s https://picockpit.com/setup.sh)"
Here you will run into another problem, “ModuleNotFoundError: No module named ‘picockpit-client'” – I will investigate this, if further users ask me to make PiCockpit available on Ubuntu.