How to change Python version in Domoticz on raspberry

Python and python framework
Post Reply
canix1
Posts: 9
Joined: Friday 25 May 2018 20:37
Target OS: Raspberry Pi
Domoticz version:
Contact:

How to change Python version in Domoticz on raspberry

Post by canix1 » 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

User avatar
waaren
Posts: 923
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by waaren » Thursday 14 June 2018 0:05

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.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

angelosan
Posts: 2
Joined: Sunday 09 February 2014 20:17
Target OS: Raspberry Pi
Domoticz version: 4.796
Location: Italy
Contact:

Re: How to change Python version in Domoticz on raspberry

Post by angelosan » Friday 03 August 2018 9:35

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests