Skip to content

Upgrading from Raspbian Bullseye to Bookworm

wvhn edited this page Mar 7, 2024 · 1 revision

There are certain limitations in Bookworm with Python 3.11 which forces users to set up virtual reqirements and is not fully tested with smarthomeNG. So it is recommended to use Python 3.9 or 3.10 for smarthomeNG.

Unfortunately I had still be using smarthomeNG with Python3.7 under Bullseye and had not not installed it with Python3.9 nor installed all required Python Packages. This caused some extra work after the upgrade. So I recommend to install all required Python 3.9 modules under Bullseye and set up smarthomeNG to run in Python 3.9 before the upgrade to Bookworm. Python-venv should be installed with Python 3.9, too. If this is fulfilled, the likeliness of an easy start of smarthomeNG in Python 3.9 after the upgrade is quite high.

I followed this instruction for the OS upgrade. It went quite smoothly but I recommend to skip apt autoremove and apt autoclean in the end and check the packages manually after finishing all other installation steps of smarthomeNG.

With sudo ln -sfn /usr/bin/python3.9 python3 I switched the default Python version to v3.9. Since Python 3.9 had not been installed completely before the OS upgrade I ran into some problems with pip version and missing dependencies "distutils" and "lib2to3". I found the dependencies for Python 3.9 in /var/cache/apt/archives and installed them using sudo dpkg - i .... This breaks Python 3.11 installation. I copied the folder "/lib/python3.9/distutils" and ".../lib2to3" to backup folders and then repaired the Python 3.11 installation with sudo sudo apt --fix-broken install.

Now I was able to start smarthomeNG and install the missing requirements. If pip should be missing it can be installed with the script get-pip.py.

After all I wanted to test virtual environments. The make of a venv failed because of a missing ensure-pip module. This post helped me out.