Trying to run two different Python versions with bookworm

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
hjzwiers
Posts: 215
Joined: Friday 12 January 2018 8:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Trying to run two different Python versions with bookworm

Post by hjzwiers »

Just switched to bookworm
I noticed an item was added to
sudo nano /etc/init.d/domoticz.sh, the startup file
export PYTHONPATH=/home/hjz/domoticz/Domoticz_Python_Environment:$PYTHONPATH

To add a different version I downloaded the "pyenv" application and stated that 3.10 must be used for the plugin with the tapo

hjz@debian:~/domoticz/plugins/tapo$ pyenv versions
system
* 3.10.0 (set by /home/hjz/domoticz/plugins/tapo/.python-version)
3.10.0/envs/myenv
3.10.0/envs/tapo
myenv --> /home/hjz/.pyenv/versions/3.10.0/envs/myenv
tapo --> /home/hjz/.pyenv/versions/3.10.0/envs/tapo

But when I run the files
Tapo: (TapoP100) failed to load 'plugin.py', Python Path used was '/home/hjz/domoticz/plugins/tapo/:/home/hjz/domoticz/Domoticz_Python_Environment:/home/hjz/domoticz:/usr/lib/python311.zip:/usr/lib/python3.11:/usr/lib/python3.11/lib-dynload:/usr/local/lib/python3.11/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.11/dist-packages'.
2025-05-15 18:31:48.208 Error: Tapo: Traceback (most recent call last):
2025-05-15 18:31:48.208 Error: Tapo: File "/home/hjz/domoticz/plugins/tapo/plugin.py", line 35, in <module>
2025-05-15 18:31:48.208 Error: Tapo: raise Exception("Incompatible Python version. Please use Python 3.10.x.")
2025-05-15 18:31:48.208 Error: Tapo: Exception: Incompatible Python version. Please use Python 3.10.x.

What is going wrong? Is the PYTHONPATH overruling the path I set with pvenv?
User avatar
waltervl
Posts: 5733
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Trying to run two different Python versions with bookworm

Post by waltervl »

Perhaps this topic will give the answers: viewtopic.php?p=322096#p322096
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 1 guest