yglukhov / nimpy

Nim - Python bridge
MIT License
1.48k stars 60 forks source link

undefined symbol: _PyModule_Add [Exception] #292

Closed qqtop closed 1 year ago

qqtop commented 1 year ago

import nimpy let datetime = pyImport("datetime")

Fails after a recent python3 update:

py_utils.nim(98) raisePythonError Error: unhandled exception: <class 'ImportError'>: /usr/lib64/python3.11/lib-dynload/math.cpython-311-x86_64-linux-gnu.so: undefined symbol: _PyModule_Add [Exception]

yglukhov commented 1 year ago

I can not reproduce this with latest python 3.11.5 on arch linux. Looks like a problem with your python installation?

qqtop commented 1 year ago

Thank you for reply , the error here pops up on:

openSUSE Tumbleweed Python 3.11.5 (main, Aug 31 2023, 07:57:41) [GCC]

All other pyimport statements compile fine and do not exhibit any problems.

I will further investigate. Thank you for nimpy !

qqtop commented 1 year ago

The issue was resolved after realising that nimpy looks for /usr/lib64/libpython3.11.so.1 but openSuse provides and updates only /usr/lib64/libpython3.11.so.1.0 . Once both files where the same nimpy worked as expected again.