ELFI requires Python 3.7 or greater (see below how to install). To install ELFI, simply type in your terminal:
pip install elfi
Installing Python 3.7
If you are new to Python, perhaps the simplest way to install it is with Anaconda that manages different Python versions. After installing Anaconda, you can create a Python 3.7. environment with ELFI:
conda create -n elfi python=3.7 numpy source activate elfi pip install elfi
We recommend to install:
graphvizfor drawing graphical models (
pip install graphvizrequires Graphviz binaries).
Potential problems with installation
ELFI depends on several other Python packages, which have their own dependencies. Resolving these may sometimes go wrong:
If you receive an error about missing
numpy, please install it first.
If you receive an error about yaml.load, install
On OS X with Anaconda virtual environment say conda install python.app and then use pythonw instead of python.
Note that ELFI requires Python 3.7 or greater
In some environments
piprefers to Python 2.x, and you have to use
pip3to use the Python 3.x version
Make sure your Python installation meets the versions listed in requirements.
Developer installation from sources
The sources for ELFI can be downloaded from the Github repo.
You can either clone the public repository:
git clone https://github.com/elfi-dev/elfi.git
Or download the development tarball:
curl -OL https://github.com/elfi-dev/elfi/tarball/dev
Note that for development it is recommended to base your work on the dev branch instead of master.
Once you have a copy of the source, go to the folder and type:
pip install -e .
This will install ELFI along with its default requirements. Note that the dot in the end means the current folder.
A simple Dockerfile with Jupyter support is also provided. This is especially suitable for running tests. Please see Docker documentation for details.
git clone --depth 1 https://github.com/elfi-dev/elfi.git cd elfi make docker-build # builds the image with requirements for dev make docker # runs a container with live elfi directory
To open a Jupyter notebook, run
jupyter notebook --ip 0.0.0.0 --no-browser --allow-root
within the container and then on host open the page localhost:8888.