Installation requirements

Some use cases require an OpenFisca installation in a local environment where some tools should be pre-installed. First establish if the use case requires installation via the getting started page.

OpenFisca runs with Python.

If the local environment already has an appropriate Python version (with pip) then this step can be skipped. Check the OpenFisca country package for supported Python versions.

All country templates depend on the OpenFisca Core package, at the time of writing, OpenFisca Core supports python versions 3.9 -> 3.11.

Check Python installation

To check the pip installation run this command in the local terminal:

pip --version

If this results in pip: command not found, then installing Python is required.

Install Python

Python installation is required to run OpenFisca code on a local environment. The Python version required depends on the OpenFisca country package to be installed.

How to find the Python version of a model

These instructions apply to the OpenFisca-Country-Template by way of example, other country packages have a similar structure.

To identify the Python revision of the OpenFisca-Country-Template:

  1. Check the pyproject.toml* of the OpenFisca-Country-Template repository,

  2. Check the classifiers values where the Python version is described by a value like "Programming Language :: Python :: 3.11" (here 3.11)

  3. When multiple Python versions are listed, it is advised to install the most recent version (3.11 for example if 3.9, 3.10 and 3.11 are listed).

* In some older versions of country packages the information will instead be in the setup.py file at the root of the project.

Install a Python version

Python installation depends on the operating system.

Follow the default installation instructions in the Python official documentation. Find the appropriate version required before proceeding to install.

Docker users might find it easier to follow a different installation for Python and rely on Python official image instead. See the Install with Docker page.

Recommendations for Windows users

Microsoft Windows users can also utilise the conda package and environment manager to install the OpenFisca-Country-Template published on PyPi or one of the OpenFisca packages published on PyPi.

OpenFisca-Country-Template is also published as conda package but the available openfisca packages list is shorter.

To install Python through conda:

Contributing to the rules (Git)

Source code is managed with the Git version control system. If the use-case includes contributing to the rules, Git is going to be an essential requirement.

To can check for a valid Git installation run this command:

git --version

It should return the version of Git if Git is installed. If Git isn’t installed, follow the official documentation to install Git for the latest version.

It is recommended to contact those maintaining the relevant package to gain appropriate access first.

Accessing the source code with git should be done via SSH. Using the OpenFisca Country Template as an example the following command demonstrates how that is achieved:

git clone git@github.com:openfisca/country-template.git

If new to SSH, follow these Github instructions on setting up SSH specific to Github.

Note: accessing via HTTPS is not recommended.