Skip to content

Instantly share code, notes, and snippets.

@stevenbedrick
Created October 10, 2017 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenbedrick/d3bdbbb082dcc6b8dfb7a60364e7ed37 to your computer and use it in GitHub Desktop.
Save stevenbedrick/d3bdbbb082dcc6b8dfb7a60364e7ed37 to your computer and use it in GitHub Desktop.
Installing pynini in a virtual environment
steven@bigbird0:~$ mkdir pynini_test
steven@bigbird0:~$ cd pynini_test/
steven@bigbird0:~/pynini_test$ virtualenv ./venv
New python executable in /mnt/emu/g/steven/pynini_test/venv/bin/python
Installing setuptools, pip, wheel...done.
steven@bigbird0:~/pynini_test$ source venv/bin/activate
(venv) steven@bigbird0:~/pynini_test$ wget http://openfst.cs.nyu.edu/twiki/pub/GRM/PyniniDownload/pynini-1.7.tar.gz
--2017-10-10 10:18:50-- http://openfst.cs.nyu.edu/twiki/pub/GRM/PyniniDownload/pynini-1.7.tar.gz
Resolving openfst.cs.nyu.edu (openfst.cs.nyu.edu)... 128.122.80.127
Connecting to openfst.cs.nyu.edu (openfst.cs.nyu.edu)|128.122.80.127|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 677732 (662K) [application/x-gzip]
Saving to: ‘pynini-1.7.tar.gz’
pynini-1.7.tar.gz 100%[============================================================================>] 661.85K 19.9KB/s in 18s
2017-10-10 10:19:08 (37.2 KB/s) - ‘pynini-1.7.tar.gz’ saved [677732/677732]
(venv) steven@bigbird0:~/pynini_test$ tar -xzvf pynini-1.7.tar.gz
(venv) steven@bigbird0:~/pynini_test$ tar -xzvf pynini-1.7.tar.gz
pynini-1.7/
pynini-1.7/pynini.pdf
pynini-1.7/README.rst
...
pynini-1.7/pynini.egg-info/PKG-INFO
pynini-1.7/pynini.egg-info/top_level.txt
pynini-1.7/pynini.egg-info/SOURCES.txt
(venv) steven@bigbird0:~/pynini_test$ cd pynini-1.7/
(venv) steven@bigbird0:~/pynini_test/pynini-1.7$ python setup.py install
running install
running bdist_egg
running egg_info
...
[[[[ SNIP LOTS OF COMPILER WARNINGS ]]]]
creating 'dist/pynini-1.7-py2.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pynini-1.7-py2.7-linux-x86_64.egg
Copying pynini-1.7-py2.7-linux-x86_64.egg to /mnt/emu/g/steven/pynini_test/venv/lib/python2.7/site-packages
Adding pynini 1.7 to easy-install.pth file
Installed /mnt/emu/g/steven/pynini_test/venv/lib/python2.7/site-packages/pynini-1.7-py2.7-linux-x86_64.egg
Processing dependencies for pynini==1.7
Finished processing dependencies for pynini==1.7
(venv) steven@bigbird0:~/pynini_test/pynini-1.7$ cd ..
(venv) steven@bigbird0:~/pynini_test$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pynini
>>> print(pynini.acceptor("foo"))
0 1 f
1 2 o
2 3 o
3
>>> ^D
(venv) steven@bigbird0:~/pynini_test$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment