Unable to compile with both python event-scripts and python plugins

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
moroen
Posts: 408
Joined: Sunday 15 January 2017 11:06
Target OS: Linux
Domoticz version: beta
Location: Norway
Contact:

Unable to compile with both python event-scripts and python plugins

Post by moroen »

Hello,

Using latest master-branch from github, I'm not able to compile with support for BOTH the new python plugins and using python event-scripts.

Using a cmake-configuration with python3.4 it's no problem compiling with support for plugins, and using a cmake-configuration with python2.7, no problem compiling with support for python event-scripts. I believe the problem stems from the changed python-API between major version 2 and 3.
/home/mak/domoticz/domoticz-py3/main/EventSystem.cpp:2233:45: error: ‘Py_InitModule’ was not declared in this scope
Py_InitModule("domoticz_", DomoticzMethods);
the python code in EventSystem.cpp appears to be using the old 2.7-api, and thus unable to compile using python3, required for plugins...

I've taken a look at the EventSystem.cpp, but my CPP-mojo is far from adequate for trying to update the code to use python3.

I guests I could port my pyton-scripts to LUA, but since the introduction of python-plugins, python feels like the way to go, and my scripts depend on some python modules.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest