voikko / corevoikko

Libvoikko and essential linguistic resources
Other
89 stars 25 forks source link

voikkoInsertHyphensCstr is undefined on Debian 4.9.130-2 #44

Closed philipto closed 3 years ago

philipto commented 4 years ago

I am trying to work with voikko on Debian 9. All libraries are installed, FI language files is in /etc/voikko/5. The error:

AttributeError: /usr/lib/x86_64-linux-gnu/libvoikko.so.1: undefined symbol: voikkoInsertHyphensCstr

This is full log:

>>> from libvoikko import Voikko
>>> v = Voikko('fi_FI')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/libvoikko.py", line 436, in __init__
    self.__lib = self.__getLib()
  File "/usr/local/lib/python3.5/dist-packages/libvoikko.py", line 422, in __getLib
    return VoikkoLibrary.open(path=cls._sharedLibrarySearchPath)
  File "/usr/local/lib/python3.5/dist-packages/libvoikko.py", line 302, in open
    return cls(fileName)
  File "/usr/local/lib/python3.5/dist-packages/libvoikko.py", line 346, in __init__
    self.voikkoInsertHyphensCstr.argtypes = [c_void_p, c_char_p, c_char_p, c_int]
  File "/usr/lib/python3.5/ctypes/__init__.py", line 360, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.5/ctypes/__init__.py", line 365, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libvoikko.so.1: undefined symbol: voikkoInsertHyphensCstr
philipto commented 4 years ago

In fact, I resolved the issue by installing libvoikko from sources. It required few dependencies, but it was easier to resolve them than to fix the issue. You may wish to update official package repository for Debian: if I am not mistaken, it has libvoikko-4.1, and the most recent (and successfully compiled at my Linux) version is libvoikko-4.3.

hatapitk commented 3 years ago

voikkoInsertHyphensCstr was indeed added in libvoikko 4.2 and Debian 9 has libvoikko 4.1. Any wrapper library shipped with libvoikko must be used with equally new or newer version of libvoikko.so.1. So the error is not a bug.