Ubuntu Linux

Configuring Python

pyvale supports Python 3.11 and newer. The optional Blender backend requires Python 3.13; install it with pip install "pyvale[blender]". To install a specific Python version without changing your operating system Python, first add the deadsnakes repository to apt:

sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt update

For example, install Python 3.13 for Blender:

sudo apt install python3.13 python3.13-dev python3.13-venv

Check the selected Python installation using the following command:

python3.13

If everything has worked you should see an interactive Python console. You can now exit it using quit().

Interactive ROI Dependencies

For the interactive ROI tool to work, there’s a couple of system level libraries that are required:

sudo apt install -y libegl1 libgl1 libxext6 libx11-6

Virtual Environment

We recommend installing pyvale in a virtual environment using venv or pyvale can be installed into an existing environment of your choice. To create a specific virtual environment for pyvale navigate to the directory you want to install the environment and use:

python -m venv pyvale-env

Now activate the virtual environment:

source pyvale-env/bin/activate

If you need to activate the environment again in a new terminal use the above command from the directory containing the ‘pyvale-env’ directory.

Installation from PyPI

pyvale can be installed from PyPI. Ensure you virtual environment is activated (you should see ‘(pyvale-env)’ in your terminal) and run the following from the pyvale directory:

pip install pyvale

You should now be able to start a Python interpreter in your terminal using (again make sure your pyvale-env is active):

python

Now check that you can import pyvale in the interpreter:

import pyvale

If there are no errors then everything has worked and you can now move on to looking at some of our examples to get you started in the basics section.

Installation from Source

When installing from source you’ll need a C/C++ compiler and libtiff. It’s likely that you’ll already have one. If not, you can install it using the apt package manager with:

sudo apt update
sudo apt install gcc g++ libtiff-dev

For the ROI tool, you’ll need the Interactive ROI dependencies. Once done, you can clone pyvale to your local system using:

git clone https://github.com/Computer-Aided-Validation-Laboratory/pyvale.git

cd to the root directory of pyvale. Ensure you virtual environment is activated and run the following commmand from the pyvale directory:

pip install -e .

This will create an editable/developer installation of pyvale. Now check that you can import pyvale in the interpreter:

import pyvale

If there are no errors then everything has worked and you can now move on to looking at some of our examples to get you started in the basics section.