I'm tyring to use sidekit toolkit for speaker recognition and I have installed libsvm for Ubuntu, I'm using anaconda 3.5. When I try to import sidekit I get following import error
>>> import sidekit
>>> import theano
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/shivam/anaconda3/lib/python3.5/site-packages/sidekit/__init__.py",
line 141, in <module>
from sidekit.libsvm import *
File "/home/shivam/anaconda3/lib/python3.5/site-packages/sidekit/libsvm/__init__.py",
line 37, in <module>
from sidekit.libsvm.svm import *
File "/home/shivam/anaconda3/lib/python3.5/site-packages/sidekit/libsvm/svm.py",
line 324, in <module>
fillprototype(libsvm.svm_get_sv_indices, None, [POINTER(svm_model), POINTER(c_int)])
File "/home/shivam/anaconda3/lib/python3.5/ctypes/__init__.py", line 360, in __getattr__
func = self.__getitem__(name)
File "/home/shivam/anaconda3/lib/python3.5/ctypes/__init__.py", line 365, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libsvm.so.3: undefined symbol: svm_get_sv_indices
I had the same problem when I installed Sidekit some months ago.
1: If you want to use Sidekit for systems that do not involve SVMs (gmm-ubm, i-vectors etc.), then you can avoid the problem by editing
__init__.py
to not import libsvm. In your case, it is located here:/home/shivam/anaconda3/lib/python3.5/site-packages/sidekit/__init__.py
. Addlibsvm_loaded = False
on line 140 (right aboveif libsvm_loaded:
), and libsvm will not be imported.2: If you want to be able to make SVM-based systems (such as in the example script
rsr2015_svm_gmm.py
), the Sidekit documentation tells you to (after libsvm installation) copylibsvm.so.2
into.../python3.5/site-packages/sidekit/libsvm/
.If
import sidekit
still gives the same error, check line 125 of.../python3.5/site-packages/sidekit/__init__.py
and make sure it sayslibsvm = CDLL(os.path.join(dirname, 'libsvm.so.2'))
Note that
__init__.py
and will be replaced if you are to update Sidekit.