PyFst installation instructions

From 11-711
Jump to: navigation, search

Re-installing OpenFST

HomeWork 0 instructs you to install OpenFST to some home directory. Unfortunately, this does not work with PyFST. If you did not install OpenFST globally, you need to re-install it. Go to the folder with source files and type:


make -j4

sudo make install

Installing Python 2.7-DEV

It turned out that (at least some older versions of) PyFST may not work with Python versions other than 2.7. If you call the fst.CreateTable() function and get an error:

/usr/local/lib/python2.6/dist-packages/fst/ in

fst._fst.SymbolTable.__init__ (fst/_fst.cpp:2611)()

then you are most likely using an incompatible Python version. First, try to upgrade the PyFST:

pip install --upgrade pyfst

If this does not help, you need to upgrade Python. If you already have version is 2.7, make sure it is a DEV version. On Ubuntu 12 you install the DEV-version by typing:

sudo apt-get install python2.7-dev

Older Ubuntu distributions that rely on Python2.6

Install the DEV version of SSL. On Ubuntu you need to install the package libssl-dev.

Download Python2.7.5. Note the minor version! You really need 2.7.5. Do (on Linux):



sudo make install

Then, you need to install additional tools.


Download the Setuptools, unpack and execute:

sudo python install


You cannot use pip that came with another Python version. You need to install a new one as follows:

sudo easy_install pip

You can check if your pip is in the right version by running:

pip --version

It should end with python 2.7 rather than your original other version.

Python notebook

sudo pip install ipython[all]


Now you are ready to install pyfst:

pip install pyfst