Skip to content

Installation

[Git clone : pvgis] [Install via pip : pip install git+]

Under active development

This page is under development and subject to change!

Requirements

Environment setup

To begin with, create a Python virtual environment! and activate it :

python -m venv .venv
source .venv/bin/activate
Virtual environment name

.venv is the name selected for the virtual environment above. Using this name, git will automatically ignore files inside this directory, as this specific name is registered in .gitignore.

Disallow to install outside a virtual environment

Forgetting to activate a virtual environment will install various packages outside virtual environments at a system-wide level which, over time, will likely lead to errors.

By setting for example in .bashrc or .zshrc the environment variable PIP_REQUIRE_VIRTUALENV to true and re-starting your shell, pip will refuse to install anything outside a virtual environment.

export PIP_REQUIRE_VIRTUALENV=true
Use direnv to work seamlessly with virtual environments

Regardless of our favourite programming language or tool to manage environments, chances are high we'd benefit from using direnv. In the context of a Python package, direnv supports all such well known tools from standard venv, pyenv and pipenv, to anaconda, Poetry, Hatch, Rye and PDM. Have a look at direnv's Wiki page for Python.

pvgis is developed inside a virtual environment (re-)created and (re-)activated via direnv. The following .envrc does all of it :

export VIRTUAL_ENV=".venv"
layout python-venv python3

Find more about layout python in direnv/wiki/Python#venv-stdlib-module.

Installation from PyPi

Coming soon!

Installation from source

Simple install

Once inside a dedicated virtual environment, we can install PVIS with a single command using pip, Python's standard package installer:

$ pip install git+https://code.europa.eu/pvgis/pvgis.git
---> 100%
..
Building wheels for collected packages: pvgis
Building wheel for pvgis (pyproject.toml) ... done
Created wheel for pvgis: filename=pvgis-6.x.x-py3-none-any.whl 
Successfully built pvgis
..
Copy the command
pip install git+https://code.europa.eu/pvgis/pvgis.git

Install a tagged version

Coming soon!

Install using uv

First install uv into your virtual environment:

$ pip install uv
---> 100%
..
Building wheels for collected packages: uv
Building wheel for uv (pyproject.toml) ... done
Successfully built uv
..

And run:

$ uv pip install git+https://code.europa.eu/pvgis/pvgis.git
---> 100%
..
Building wheels for collected packages: pvgis
Building wheel for pvgis (pyproject.toml) ... done
Created wheel for pvgis: filename=pvgis-6.x.x-py3-none-any.whl 
Successfully built pvgis
..

Conda

In order to install the software using conda (instructions for installing conda can be found here):

  1. First clone the software to get the latest changes:

    $ git clone https://code.europa.eu/pvgis/pvgis.git
    ---> 100%
    
  2. Then, navigate into the source code directory:

    $ cd pvgis
    
  3. Create the conda environment by running the following command. This will create an new conda environment named pvgis and install the PVGIS software along with its dependencies using the environment.yml file that is distributed with the software:

    $ conda env create
    ---> 100%
    
  4. Finally, activate the conda environment:

    $ conda activate pvgis
    

For Developers

Curious to explore the latest (non-released development) version? Want to modify some function or add a new one and contribute to PVGIS? You can install PVGIS in an editable mode.

Using pip

  1. Clone the source code repository

    $ git clone https://code.europa.eu/pvgis/pvgis.git
    ---> 100%
    
  2. Step in the source code directory

    $ cd pvgis
    
  3. Install in editable mode

    $ pip install -e ."[all]"
    ---> 100%
    

Using uv

Similarly to the above instructions, you can use uv to install PVGIS in editable mode.

Warning

PVIS is under development so for the time being you may want to install either all dependencies or the dev ones. For the latter option, you can do

pip install ."[dev]"

This will install all of : the core API and the CLI.

Note

The installation will include Rich. Rich is a library to display visually pleasing information on the terminal. It is deeply integrated into PVGIS.

Verify

We can verify the installation was successful by running any command (i.e. pvgis) or asking for the version of the installed package:

pvgis --version
PVGIS prototype version: 0.1.dev150+ge2ee93156

After the installation

Uninstall

You can uninstall pvgis with pip:

$ pip uninstall pvgis
---> 100%

If you are using uv, run:

$ uv pip uninstall pvgis
---> 100%

This removes the pvgis package from your current environment.