0

I'm trying to write Python code to manipulate Xerox FST files, and I've installed the Python bindings for libxfsm and the XFSM library available through http://fsmbook.com. I'm running 64-bit Ubuntu. The installation goes fine, but when I try to import the xfsm module, I get this error:

>>> import xfsm
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/xfsm/__init__.py", line
 30, in <module>
    import xfsm.errors # So error handler gets installed
  File "/usr/local/lib/python2.7/dist-packages/xfsm/errors.py", line
 8, in <module>
    from xfsm.utils import *
  File "/usr/local/lib/python2.7/dist-packages/xfsm/utils.py", line
 39, in <module>
    libc = cfsm.load_library("c")
  File "/usr/local/lib/python2.7/dist-packages/xfsm/cfsm_api.py", line
 366, in l                 oad_library
    raise ImportError("%s not found." % libname)
 ImportError: c not found.

Inspecting the source code for the Python interface, it looks like it is trying and failing to find libc, and failing, but I am at a loss on how to fix that.

Has anybody else gotten the Python-XFST interface working, or have any idea what's going wrong and how to fix it?

Logan R. Kearsley
  • 682
  • 1
  • 5
  • 19

1 Answers1

1

I had same problem on 64-bit Ubuntu 14.04. The problem is it can't find libc. In my case libc on my OS is name libc.so.6(I don't know why, I am new on Ubuntu). But the Python-XFST doesn't recognize it (Detail your can refer to source file)

My solution is simple, just modify xfsm/utils.py file in

**Line 39** : libc = cfsm.load_library("c")

to

**Line 39** : libc = cfsm.load_library("libc.so.6")

Remember to add the path to libc.so.6 in env.

BryceSi
  • 39
  • 2