Getting Started with VerifAI

VerifAI requires Python 3.8 or newer. Run python --version to make sure you have a new enough version; if not, you can install one from the Python website or using pyenv (e.g. running pyenv install 3.11). If the version of Python you want to use is called something different than just python on your system, e.g. python3.11, use that name in place of python throughout the following instructions.

There are two ways to install VerifAI:

  • from our repository, which has the very latest features but may not be stable. The repository also contains example scripts such as those used in the tutorial.

  • from the Python Package Index (PyPI), which will get you the latest official release of VerifAI but will not include example code, etc.

If this is your first time using VerifAI, we suggest installing from the repository so that you can try out the examples.

Once you’ve decided which method you want to use, follow the instructions below, which should work on macOS and Linux (on Windows, we recommend using the Windows Subsystem for Linux).

First, activate the virtual environment in which you want to install VerifAI. To create and activate a new virtual environment called venv, you can run the following commands:

python -m venv venv
source venv/bin/activate

Once your virtual environment is activated, make sure your pip tool is up-to-date:

python -m pip install --upgrade pip

Now you can install VerifAI either from the repository or from PyPI:

The following commands will clone the VerifAI repository into a folder called VerifAI and install VerifAI from there. It is an “editable install”, so if you later update the repository with git pull or make changes to the code yourself, you won’t need to reinstall VerifAI.

git clone https://github.com/BerkeleyLearnVerify/VerifAI
cd VerifAI
python -m pip install -e .

Some features of VerifAI require additional packages: the tool will prompt you if they are needed but not installed.

Note

In the past, the GPy package did not always install correctly through the automated process. If necessary, you can build it from source as follows:

git clone https://github.com/SheffieldML/GPy
find GPy -name '*.pyx' -exec cython {} \
pip install GPy/