Skip to content
Kimmo Koskenniemi edited this page Feb 19, 2018 · 6 revisions

How to install datrie

The beta.py program depends on a package datrie, see Python Package Index (PyPI). The package datrie implements so called tries or letter trees (trie) very efficiently which is essential in the Beta algorithm. Thanks to it, beta.py can handle grammars with thousands of rules in an efficient manner.

On all systems, the package datrie can be loaded for global use (if you have the priviliges) by using a command (which is the recommended way):

$ python3 -m pip install datrie

which works for Python 3.4 or later. An alternative way is (again if you have sufficient privileges, and if pip3 is already installed on your system):

$ pip3 install datrie

If pip3 is not installed on your system, you must first install it by some means specific to your system.

On Windows systems, the attempt to install datrie may complain that you need "visual-cpp-build-tools" package in order to install datrie. Such a package is available from the net. Just load the installer file and run the installer, and repeat the installation of datrie as above.

On Mac iOS you probably need the "Xcode" package in order to install datrie. Xcode is freely available from the AppStore.

In Linux systems, all packages needed for the installation of datrie are usually already a part of the system.

If you are using a server for which you have only normal user privileges, you might use the following command in order to install datrie in your home directory:

$ python3 -m pip install --install-option="--prefix=$HOME/.local" datrie

You can use such a local installation just as easily as a global installation. The only difference is that other users on the same computer must install their own copies.

Clone this wiki locally