Installation¶
We recommend using the latest version of Python 3, LibLET is tested under Python 3.7 and newer. These packages (and the related dependencies) will be installed automatically when installing LibLET:
antlr4-python3-runtime the runtime of ANTLR 4 for Python 3;
jupyter a web application to create documents that contain live code, math, visualizations and narrative text;
graphviz the Python binding for the Graphviz graph visualization software.
Virtual environments¶
It’s suggested to use a virtual environment to manage Python dependencies: virtual environments are independent groups of Python libraries, one for each project; packages installed for one project will not affect other projects or the operating system’s packages.
Create an environment¶
Python 3 comes bundled with the venv
module to create virtual
environments. Create a project folder and a venv
folder within:
$ mkdir myproject
$ cd myproject
$ python3 -m venv venv
On Windows:
$ py -3 -m venv venv
Activate the environment¶
Every time you decide to use the library, activate the environment:
$ . venv/bin/activate
On Windows:
> venv\Scripts\activate
Install the library¶
Within the activated environment, use the following command to install the library:
$ pip install liblet
Install the external dependencies¶
To use LibLET you also need to manually install:
the Graphviz visualization software,
the ANTLR Tool, that is antlr-4.7.2-complete.jar, and
the LLVM toolchain in case you want to use the
LLVM
helper class (present code is tested with version 10 of the toolchain).
Follow the installation instruction on the Graphviz and LLVM sites according to your operating system and package manager.
To install the ANTLR Tool, you can use the install_antlrjar command provided by LibLET as:
$ install_antlrjar
and set the ANTLR4_JAR
environment variable to the full path of the
downloaded jar as advised. Finally, if you plan to use the
LLVM
helper class, set the LLVM_VERSION
environment variable to the installed toolchain version.