mz-automation / libiec61850

Official repository for libIEC61850, the open-source library for the IEC 61850 protocols
http://libiec61850.com/libiec61850
GNU General Public License v3.0
863 stars 461 forks source link

GIL error importing library on Windows #470

Open KartikSoneji opened 1 year ago

KartikSoneji commented 1 year ago

Hi, I am on the v1.4 branch (since 1.5 doesn't seem to work without winpcap) and am getting this error after compiling and installing the library on Windows. I did have to manually copy iec61850.dll to the python Scripts folder, not sure if that's the right way but python was unable to find the library otherwise.

Now I see this error while importing the library.

> py

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import iec61840
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'iec61840'
>>> import iec61850
Fatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held,
  but the GIL is released (the current Python thread state is NULL)
Python runtime state: unknown

Build commands:

md build
cd build
cmake .. -DBUILD_PYTHON_BINDINGS=ON
cmake --build . -t install
mbourhis commented 11 months ago

Same issue: https://github.com/mz-automation/libiec61850/issues/479