Python 3.3 or later comes with venv. For Python 3.* < 3.3 with apt:
$ sudo apt install python3-venv
To create, activate and pip install packages:
$ python -m venv my_venv
$ source my_venv/bin/activate
(my_venv)$ pip install gimpformats
To deactivate the venv:
(my_venv)$ deactivate
This allows to have Python virtual environments with isolation. It’s particularly useful when using systems that don’t allow to use pip directly as WSL (Windows Subsystem for Linux).