How to use self compiled python for domoticz build
Posted: Friday 24 March 2023 18:33
Hi,
I have difficulties building my own domoticz version with my own python version.
The error message during cmake is
I need this because I have written a plugin for domoticz that automatically creates switches and sensors for tasmota devices and want to test it with different python versions.
To get a python version I use this getpy.sh script:
To compile domoticz I follow https://www.domoticz.com/wiki/Build_Dom ... rom_source
On Opensuse Tumbleweed I have cmake 3.17.3 and boost 1_81_0.
I compiled and installed z-wave with tag 1.6 (latest has compile error about null values)
So I think I meet the requirements.
What do I need in addition to make the domoticz build find my python?
I have difficulties building my own domoticz version with my own python version.
The error message during cmake is
Code: Select all
-- Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS Development) (Required is at least version "3.4")
CMake Error at CMakeLists.txt:449 (MESSAGE):
Python3 not found on your system, use USE_PYTHON=NO or sudo apt-get install
python3-dev)
To get a python version I use this getpy.sh script:
Code: Select all
#!/bin/bash
# get version (like available in ftp_url) and directory where to install
# needs relevant dev packages installed:
# zypper in tk-devel sqlite3-devel gdbm-devel readline6-devel openssl-devel libffi-devel
ver="${1-3.10.10}"
dir="${2-$PWD}"
instdir="$dir/python-$ver"
echo "Installing python to '$instdir'"
mkdir -p "$instdir"
cd "$instdir"
wget -O- "https://www.python.org/ftp/python/$ver/Python-$ver.tar.xz" | tar xJf -
cd "Python-$ver"
./configure --enable-optimizations --with-lto=full --enable-shared --prefix="$instdir" --libdir="$instdir/lib"
make -j8
make install
"$instdir/bin/python3" -m venv "$instdir/venv/base"
. "$instdir/venv/base/bin/activate"
python3 --version
On Opensuse Tumbleweed I have cmake 3.17.3 and boost 1_81_0.
I compiled and installed z-wave with tag 1.6 (latest has compile error about null values)
So I think I meet the requirements.
What do I need in addition to make the domoticz build find my python?
Code: Select all
(base) job4:~/domoticz > python --version
Python 3.10.10
(base) job4:~/domoticz > which python
/home/domoticz/python-3.10.10/venv/base/bin/python
(base) job4:~/domoticz > ls /home/domoticz/python-3.10.10
bin include lib Python-3.10.10 share venv