Installation Guide¶
This page explains the installation of the Python 3 package alogos and its optional dependencies.
Required: alogos¶
The package alogos is available on the Python Package Index (PyPI) and therefore can be easily installed with Python’s default package manager pip by using the following command in a shell:
$ pip install alogos
Additional remarks:
alogos is compatible with Python 3.6 upwards.
Using an environment manager like virtualenv or conda is a good idea in almost any case. These tools allow to create a virtual environment into which pip can install the package in an isolated fashion instead of globally on your system. Thereby it does not interfere with the installation of other projects, which may require a different version of some shared dependency.
Optional: Graphviz¶
alogos requires the standalone tool Graphviz and the Python package graphviz to visualize derivation trees.
Graphviz itself can not be installed via pip, but package managers of various operating systems support it. Instructions are available in the Graphviz installation guide. In Debian and Ubuntu it can be done with the package manager apt:
$ sudo apt install graphviz libgraphviz-dev
Afterwards graphviz can be installed with pip. More information can be found in the graphviz installation guide:
$ pip install graphviz
Optional: Jupyter notebook¶
alogos requires
Jupyter notebook
for displaying grammars and derivation trees inline in notebooks in form
of embedded HTML visualizations, accompanied by Python code and
Markdown comments.
A notebook is a file ending with .ipynb
, which can be created, modified and
executed with the
notebook server
and a webbrowser opened by it. Jupyter notebook can be installed according
to its recommended installation
with pip:
$ pip install notebook
Further remarks:
Caution: Some plots may not show up in the notebook with default settings. Instead only a blank area is visible. The reason is a parameter called
iopub_data_rate_limit
in Jupyter’s config system. Its value is chosen rather low by default. Plots that contain much data can therefore be blocked. This problem can be solved by increasing the value of the parameter, which can be done in two ways:Permanently change it with a config file in the directory
~/.jupyter
orTemporarily change it when opening a notebook by adding an optional argument to the start-up command:
$ jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e12