Menu

undefined symbol: ps_set_jsgf_file

Help
LogicX
2014-08-31
2014-08-31
  • LogicX

    LogicX - 2014-08-31

    I'm trying to test pocketsphinx with python. I'm using Ubuntu 14.04LTS with python 2.7.
    I installed sphinxbase & pocketsphenix from git yesterday. But unfortunately I'm stuck with following error.
     
    Command:


    python test.py t.wav
     
    Output:


    Traceback (most recent call last):
    File "test.py", line 79, in <module>
    from pocketsphinx import *
    File "/usr/local/lib/python2.7/dist-packages/pocketsphinx/pocketsphinx.py", line 46, in <module>
    _pocketsphinx = swig_import_helper()
    File "/usr/local/lib/python2.7/dist-packages/pocketsphinx/pocketsphinx.py", line 42, in swig_import_helper
    _mod = imp.load_module('_pocketsphinx', fp, pathname, description)
    ImportError: /usr/local/lib/python2.7/dist-packages/pocketsphinx/_pocketsphinx.so: undefined symbol: ps_set_jsgf_file
     
    The code I was trying to execute


    !/usr/bin/python

    import sys
    import pocketsphinx

    if name == "main":

    hmdir = "/usr/local/share/pocketsphinx/model/hmm/en_US/"
    lmdir = "/usr/local/share/pocketsphinx/model/lm/en_US/wsj0vp.5000.DMP"
    dictd = "/usr/local/share/pocketsphinx/model/lm/en_US/cmu07a.dic"
    wavfile = sys.argv[1]

    speechRec = pocketsphinx.Decoder(hmm = hmdir, lm = lmdir, dict = dictd)
    wavFile = file(wavfile,'rb')
    speechRec.decode_raw(wavFile)
    result = speechRec.get_hyp()

    print result

     
    • Nickolay V. Shmyrev

      This error means that python module tries to link to old pocketsphinx installed in your system in /usr/lib folder. You need to do the following:

      1) Remove Ubuntu packages for sphinxbase and pocketsphinx
      2) Configure linker to load libraries from /usr/local/lib folder (for example, set LD_LIBRARY_PATH or edit ld.so.conf).

       
      • LogicX

        LogicX - 2014-08-31

        Thanks, since I didn't use ubuntu packages, simple ldconfig get the error fixed.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.