How to change Python version in Domoticz on raspberry

Python and python framework

Moderator: leecollings

Post Reply
canix1
Posts: 9
Joined: Friday 25 May 2018 20:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to change Python version in Domoticz on raspberry

Post by canix1 »

Hi,

I'm struggling with getting my Domoticz installation to switch to a new version of Python (at least 3.5 ).

Domoticz says it's using 3.4.2 and is ignoring the fact that python3.6.5 is installed and that python3 --version says 3.6.5.

When I update from git and run cmake it picks up 3.4.2 and not 3.6.5.

I read that Domoticz does not work with anything newer than 3.4.2 , but on the other hand people seems to be running their plugins with 3.5 or higher.

Do anyone have any guidance?
I have to compile since I'm using Telldus Stick and Domoticz does not work unless you compile with Telldus.

Cheers
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by waaren »

canix1 wrote: Wednesday 13 June 2018 23:37 Hi,

I'm struggling with getting my Domoticz installation to switch to a new version of Python (at least 3.5 ).

Domoticz says it's using 3.4.2 and is ignoring the fact that python3.6.5 is installed and that python3 --version says 3.6.5.

When I update from git and run cmake it picks up 3.4.2 and not 3.6.5.

I read that Domoticz does not work with anything newer than 3.4.2 , but on the other hand people seems to be running their plugins with 3.5 or higher.

Do anyone have any guidance?
I have to compile since I'm using Telldus Stick and Domoticz does not work unless you compile with Telldus.

Cheers
I compile on debian stretch and I have Python 3.5.3 (on my development and on my production system)
there is quite an extensive discussion going on GITHub on this subject but what works for me:

apt install libcurl4-gnutls-dev
apt install libssl-dev

cmake -DCMAKE_BUILD_TYPE=Release CMakelists.txt
make

(the cmake will tell you that it use Python 3.4 but when execute the result binary it shows)
domoticz about:
Version: 3.9629
Build Hash: 9b2a845e-modified
Compile Date: 2018-06-12 06:45:34
dzVents Version: 2.4.6
Python Version: 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124]

and everything including all Python plugins run without problems.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
angelosan
Posts: 2
Joined: Sunday 09 February 2014 19:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.796
Location: Italy
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by angelosan »

Hi,

my solution
verify if python is installed on /usr/bin

ls -la /usr/bin/python*

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 30

update-alternatives --config python

Selezione Percorso Priorità Stato
------------------------------------------------------------
* 0 /usr/bin/python3.5 30 modalità automatica
2 /usr/bin/python3.4 20 modalità manuale
3 /usr/bin/python3.5 30 modalità manuale

or compile with:

rm -rf CMakeFiles; rm -rf CMakeCache.txt; rm -rf cmake_install.cmake Makefile

cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m/

make
djgodlike
Posts: 32
Joined: Wednesday 27 January 2016 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by djgodlike »

Hi,

I have just tried to update my Python version 3.7.3 to 3.9.7 on my Pi3B. (wanted the latest version but for this test 3.9.7 is fine)
I used this automated script for the update https://itheo.tech/ultimate-python-inst ... ntu-script

Now when i type python3 --version it shows only 3.9.7. But Domoticz still uses 3.7.3.

This is the output of ls -la /usr/bin/python*
pi@raspberrypi:~ $ python --version
Python 3.9.7
pi@raspberrypi:~ $ ls -la /usr/bin/python*
lrwxrwxrwx 1 root root 24 Oct 15 17:37 /usr/bin/python -> /etc/alternatives/python
lrwxrwxrwx 1 root root 9 Mar 4 2019 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 2984816 Oct 11 2019 /usr/bin/python2.7
lrwxrwxrwx 1 root root 36 Oct 11 2019 /usr/bin/python2.7-config -> arm-linux-gnueabihf-python2.7-config
lrwxrwxrwx 1 root root 16 Mar 4 2019 /usr/bin/python2-config -> python2.7-config
-rwxr-xr-x 1 root root 154 Dec 30 2018 /usr/bin/python2-pbr
lrwxrwxrwx 1 root root 25 Oct 15 17:37 /usr/bin/python3 -> /etc/alternatives/python3
-rwxr-xr-x 2 root root 4275580 Jan 22 2021 /usr/bin/python3.7
lrwxrwxrwx 1 root root 36 Jan 22 2021 /usr/bin/python3.7-config -> arm-linux-gnueabihf-python3.7-config
-rwxr-xr-x 2 root root 4275580 Jan 22 2021 /usr/bin/python3.7m
lrwxrwxrwx 1 root root 37 Jan 22 2021 /usr/bin/python3.7m-config -> arm-linux-gnueabihf-python3.7m-config
-rwxr-xr-x 1 root root 16284912 Oct 15 17:34 /usr/bin/python3.9
-rwxr-xr-x 1 root root 3087 Oct 15 17:36 /usr/bin/python3.9-config
lrwxrwxrwx 1 root root 16 Mar 26 2019 /usr/bin/python3-config -> python3.7-config
lrwxrwxrwx 1 root root 10 Mar 26 2019 /usr/bin/python3m -> python3.7m
lrwxrwxrwx 1 root root 17 Mar 26 2019 /usr/bin/python3m-config -> python3.7m-config
lrwxrwxrwx 1 root root 14 Mar 4 2019 /usr/bin/python-config -> python2-config
I tried both of the above solutions but without any luck.. Please help! :)


Version: 2022.1 (build 14571)
Build Hash: d96aeb254
Compile Date: 2022-10-15 16:33:27
dzVents Version: 3.1.8
Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
Aeon Labs Gen5 USB
Greenwave Powernode 6 NS310
2x Greenwave Powernode 1 NS310
Philips Hue
Logitech media Server
Plugwise Smile P1
djgodlike
Posts: 32
Joined: Wednesday 27 January 2016 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by djgodlike »

Anyone?
Aeon Labs Gen5 USB
Greenwave Powernode 6 NS310
2x Greenwave Powernode 1 NS310
Philips Hue
Logitech media Server
Plugwise Smile P1
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests