Inconsistent Python3 versions

Python and python framework

Moderator: leecollings

Post Reply
Tuinfluiter
Posts: 28
Joined: Thursday 18 January 2024 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

Inconsistent Python3 versions

Post by Tuinfluiter »

I installed a Pi4 from scratch:
Raspberry Pi Imager v1.8.5
Model: Raspberry Pi4
OS: Raspberry Pi OS (other) > Raspberry Pi OS Lite (64-bit) (Debian Bookworm)

I installed 3 docker containers: domoticz, mqtt5 and zwavejs-ui each in a container.
Imported the domoticz sqlite db from my previous Pi3B; my 5+ years of historical data is there. Top!
System runs like a charm.

Now I'm set for Python plugins .. or not?

Python version in Domoticz > About:
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
and, at the command line:
rpi4@raspi4:~ $ python3 --version
Python 3.11.2
So what is it? 3.9.2 or 3.11.2?

So I took the steps from:
https://www.domoticz.com/wiki/Using_Python_plugins
rpi4@raspi4:~ $ sudo apt install python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.11.2-1+b1).
python3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
OK
rpi4@raspi4:~ $ dpkg --get-selections | grep libpython
libpython3-stdlib:arm64 install
libpython3.11:arm64 install
libpython3.11-minimal:arm64 install
libpython3.11-stdlib:arm64 install
So libpython3.11 is there; no need to install
rpi4@raspi4:~ $ sudo apt install python3-dev
....
The following NEW packages will be installed:
javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev
python3-dev python3.11-dev zlib1g-dev
0 upgraded, 10 newly installed, 0 to remove and 12 not upgraded.
....
Again check libpython:
rpi4@raspi4:~ $ dpkg --get-selections | grep libpython
libpython3-dev:arm64 install
libpython3-stdlib:arm64 install
libpython3.11:arm64 install
libpython3.11-dev:arm64 install
libpython3.11-minimal:arm64 install
libpython3.11-stdlib:arm64 install
So libpython3-dev:arm64 is installed now
So far, so good
Reboot, just to make sure.

Check the Python3 versions: still the same:
Domoticz > About: 3.9.2
Command Line: 3.11.2

So what now?
Ignore this discrepancy and go ahead with python plugins?
I don't think I can google myself out of this.
Any suggestions?
Domoticz running on Pi4
RFXcom, Zwave2MQTT, Zigbee (Z4D), P1, OpenTherm Gateway
Tuinfluiter
Posts: 28
Joined: Thursday 18 January 2024 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Inconsistent Python3 versions

Post by Tuinfluiter »

Oh, by the way: there is no other version than version 3.11 of Python present:
rpi4@raspi4:~ $ ls -al /usr/bin/python*
lrwxrwxrwx 1 root root 7 Jan 8 2023 /usr/bin/python -> python3
lrwxrwxrwx 1 root root 10 Apr 9 2023 /usr/bin/python3 -> python3.11
-rwxr-xr-x 1 root root 6618352 Mar 13 2023 /usr/bin/python3.11
lrwxrwxrwx 1 root root 35 Mar 13 2023 /usr/bin/python3.11-config -> aarch64-linux-gnu-python3.11-config
lrwxrwxrwx 1 root root 17 Apr 9 2023 /usr/bin/python3-config -> python3.11-config
Domoticz running on Pi4
RFXcom, Zwave2MQTT, Zigbee (Z4D), P1, OpenTherm Gateway
Tuinfluiter
Posts: 28
Joined: Thursday 18 January 2024 21:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: Inconsistent Python3 versions

Post by Tuinfluiter »

Just found the answer. Topic:
https://www.domoticz.com/forum/viewtopic.php?t=40072
rerers back to the Domoticz in Docker wiki page
The Domoticz Docker container runs Python 3.9.2
So may I conclude then that for Python plugins in Domoticz the Python version on the command line doesn't matter?
Domoticz running on Pi4
RFXcom, Zwave2MQTT, Zigbee (Z4D), P1, OpenTherm Gateway
User avatar
waltervl
Posts: 5781
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Inconsistent Python3 versions

Post by waltervl »

When Domoticz runs in a Docker container it relies on the python version in the docker container.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests