PyO3 modules may only be initialized once per interpreter process
Posted: Friday 02 June 2023 16:41
We have a plugin which use the cryptophraphy 41.0.1 module, when you stop and then start the plugin (without restarting Domoticz), you get this error
I found a pointer to that GitHub issue, https://github.com/PyO3/pyo3/issues/2644 but not an expert in the embedded python library
I found a pointer to that GitHub issue, https://github.com/PyO3/pyo3/issues/2644 but not an expert in the embedded python library
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.632 Error: Zigpy-Elelabs: Call to function 'onStart' failed, exception details:
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: Traceback (most recent call last):
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: File "/var/lib/domoticz/plugins/Domoticz-Zigbee/plugin.py", line 1537, in onStart
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: _plugin.onStart()
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: File "/var/lib/domoticz/plugins/Domoticz-Zigbee/plugin.py", line 602, in onStart
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: from zigpy.config import (CONF_DEVICE, CONF_DEVICE_PATH,
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/config/__init__.py", line 32, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: from zigpy.config.validators import (
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/config/validators.py", line 9, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.646 Error: Zigpy-Elelabs: import zigpy.zdo.types as zdo_t
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/zdo/__init__.py", line 10, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: import zigpy.util
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/util.py", line 14, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: from cryptography.hazmat.primitives.ciphers import Cipher
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py", line 11, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: from cryptography.hazmat.primitives.ciphers.base import (
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 10, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: from cryptography.exceptions import (
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/exceptions.py", line 9, in <module>
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
Jun 02 16:35:43 rasp domoticz[21346]: 2023-06-02 16:35:43.647 Error: Zigpy-Elelabs: ImportError: PyO3 modules may only be initialized once per interpreter process