i am running Dietpi on my RPi 400 with Teslamate, Unbound, Adguard Home, Home Assistant and other stuff.
Managed to update Python to 3.12 as Home Assistant and other software will need it in short future.
Unfortunately, Certbot (installed using diet pi-software) no longer works. I have already uninstalled and reinstalled it using the Dietpi-software. But nothing happens.
Here is the log entry. Does anyone have any ideas? My knowledge is rudimentary, but Iβm finding my way around as far as I can.
DietPi-LetsEncrypt
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Mode: Running Certbot
[ INFO ] DietPi-LetsEncrypt | No webserver detected, running Certbot in standalone mode
Traceback (most recent call last):
File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 397, in from_name
return next(cls.discover(name=name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in <module>
sys.exit(load_entry_point('certbot==1.12.0', 'console_scripts', 'certbot')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/certbot", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 861, in distribution
return Distribution.from_name(distribution_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/metadata/__init__.py", line 399, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for certbot
[FAILED] DietPi-LetsEncrypt | Certbot failed, please check its above terminal output. Aborting...
I have searched the existing open and closed issues
Required Information
DietPi version | cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=0
G_DIETPI_VERSION_RC=2
G_GITBRANCH=βmasterβ
G_GITOWNER=βMichaIngβ
Distro version | bullseye 0
Kernel version | Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Architecture | arm64
SBC model | RPi 400
Power supply used | standard version from bundle
SD card used | SSD ist mounted
Additional Information (if applicable)
Software title | certbot
Expected behaviour
certbot should renew my crt files, used for example in Adguard Home
If you want to run Certbot on Python 3.12, it needs to be built against Python 3.12. The Debian packages are logically built against the Python version shipped by Debian, 3.11 on Bookworm. Since Python 3.12 on system level can break a lot more, I strongly recommend to restore a backup or undo/remove the custom Python installation.
No Backup to be honest as it did not seem complicated. I was following instructions from a website (which I forgot) and installed python 3.12 compiled from source. took around one hour. after that I remember that the instructions said there are now 2 versions installed and that I have to βlinkβ anything on the 3.12 version.
did a research how to βunlinkβ but did not found out what to do / what I didβ¦
Sorry, I am interested but no coding nerd. everything is learning by doing and instructions from websites. I am proud as hell to have a RPi 400 runing will all that stuff working for more then a.year xD
When installing software compiled from source, it is usually installed to /usr/local sub directories, from where you can simply rm it. Uhh, the guide does some nonsense, overwriting the Python executables from /usr/bin with symlinks to /usr/local/bin. This does not only break package consistency and is probably reverted automatically on next Python package upgrade. It is also unnecessary, as binaries in /usr/local/bin and libraries in /usr/local/lib are always prioritised anyway.
Btw, if you still have the Python 3.12 source directory, from where you installed it, you can use the following command to list all files which were/would be installed, respectively the commands done for the installation:
sudo make -n altinstall
The following ones are definitely from Python 3.12 and can be removed:
There are some below /usr/local/man, /usr/local/include and probably /usr/local/share as well.
/usr/local/bin/pip and pip3 there are from the Python 3.12 installation as well, according to their modification date. But AFAIK they are identical to the pip3.9 one, as all pip does is invoking python3 -m pip and passing through the arguments, i.e. it should not be version-specific. But you can test this: