Forked from naoko/Install OpenFst with Python Binding on OSX
Created
June 9, 2021 03:38
-
-
Save binhna/d9d88f39b1cbfa57dc1253136bebd0a1 to your computer and use it in GitHub Desktop.
How to install OpenFst with Python Biding on OSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download | |
curl -O http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.2.tar.gz | |
tar -xvzf openfst-1.6.2.tar.gz | |
rm openfst-1.6.2.tar.gz | |
cd openfst-1.6.2 | |
./configure --enable-python | |
make | |
make install | |
# Test installtion | |
fstcompile --help | |
# Test python binding | |
python | |
>>> import pywrapfst | |
# Got on error? | |
# openfst installed site-package under `/usr/local/lib/python2.7/site-packages` | |
# check if the site-package is and should not match above... | |
python -m site --user-site | |
# one way to quickly fix is to add the site-package to your python path | |
export PYTHONPATH=$PYTHONPATH:"/usr/local/lib/python2.7/site-packages" | |
# then run `import pywrapfst` should be successful |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment