Obtaining and installing PyRETIS

The latest PyRETIS release can be installed using pip:

pip3 install pyretis

This will automatically install PyRETIS and its requirements.

Note: PyRETIS will only work with Python 3.5 and newer, but pip might actually try to install for Python 2 if that is your system default. For this reason we use pip3 in the command above.

Setting up a virtual environment (optional)

You can also install PyRETIS in a virtual environment. Using a virtual environment is recommended as it will help you maintain different versions of PyRETIS and it’s dependencies. The following steps are needed to set up a virtual environment:

  1. Install the virtualenv package, for instance using

    apt

    sudo apt-get install virtualenv
    

    or pip:

    pip install virtualenv
    
  2. Create a folder dedicated to your virtual environments, for instance in your home directory

    mkdir ~/myenvfolder
    cd ~/myenvfolder
    
  3. Install the new environment with the desired Python3 interpreter, using the path to the desired Python executable (usually found in /usr/bin/), and a name for the virtual environment folder (python-3.5-env):

    virtualenv -p /usr/bin/python3.5 ~/myenvfolder/python-3.5-env
    
  4. Activate the environment:

    source ~/myenvfolder/python-3.5-env/bin/activate
    
  5. Install PyRETIS:

    pip install pyretis
    

Inside the folder ~/myenvfolder/python-3.5-env the Python environment has been created and it is characterised by its own packages which can be installed using pip. Since you have sourced the virtual environment, pip will now refer to the version of pip installed in the environment.

Note: that you will have to source the environment each time you want to make use of it using the source command given above.

The PyRETIS git repository (optional)

Previous versions and the latest (possibly unstable) sources can be obtained using git:

git clone git@gitlab.com:pyretis/pyretis.git

Requirements for PyRETIS

In order to run PyRETIS, the following Python libraries are needed:

These packages can be installed by:

pip3 install -r requirements.txt

using the requirements.txt file in the source code directory. This should be automatically done if you are installing PyRETIS using pip.