我手动编译python-openzwave以使用C++ library。
我想将它用作 Kodi 插件(在 Pi 3 上运行的 OpenELEC),所以不能使用标准安装。我已经编译了所有内容,下载了缺失的库six
和louie
库,现在尝试运行hello_world.py
.
我当前的目录结构如下:
- root
- bin
- .lib
- config
Alarm.o
...
libopenzwave.a
libopenzwave.so
libopenzwave.so.1.4
...
- libopenzwave
driver.pxd
group.pxd
...
- louie
__init__.py
dispatcher.py
...
- openzwave
__init__.py
command.py
...
six.py
hello_world.py
但是当我运行 hello_world.py 时,我收到以下错误 -
Traceback (most recent call last):
File "hello_world.py", line 40, in <module>
from openzwave.controller import ZWaveController
File "/storage/.kodi/addons/service.multimedia.open-zwave/openzwave/controller.py", line 34, in <module>
from libopenzwave import PyStatDriver, PyControllerState
ImportError: No module named libopenzwave
如果我移动libopenzwave.a
到libopenzwave.so
根文件夹,则会收到以下错误:
Traceback (most recent call last):
File "hello_world.py", line 40, in <module>
from openzwave.controller import ZWaveController
File "/storage/.kodi/addons/service.multimedia.open-zwave/openzwave/controller.py", line 34, in <module>
from libopenzwave import PyStatDriver, PyControllerState
ImportError: dynamic module does not define init function (initlibopenzwave)
我的设置有什么问题?