Install the Python library¶
BESSER requires Python 3.11 or newer. CI tests Python 3.11 and 3.12; use one of those versions for the documented setup. Optional dependencies may have additional platform or Python version constraints.
Install from PyPI¶
Create a virtual environment:
python -m venv .venv
Activate it in your shell:
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
# Linux or macOS
source .venv/bin/activate
Install the latest published release:
python -m pip install besser
python -c "from importlib.metadata import version; print(version('besser'))"
Continue with Your first model in Python to generate your first source file.
Install from source¶
Use this path to test the integration branch or contribute a change:
git clone --branch development https://github.com/BESSER-PEARL/BESSER.git
cd BESSER
python -m venv .venv
Activate the environment as shown above, then install the checkout:
python -m pip install -e .
An editable installation makes the package importable from your scripts;
you do not need to configure PYTHONPATH for ordinary library use.
Optional dependencies¶
# OpenAI and Anthropic clients, tiktoken, Pygments and pygit2 (the merge of a
# model change into edited generated files), for the Spec-Driven Agent
python -m pip install "besser[agents]"
# Neural-network dependencies
python -m pip install "besser[nn]"
# pyshacl, for the Knowledge Graph OWL/SHACL consistency check
python -m pip install "besser[kg]"
# The B-OCL interpreter, to evaluate OCL constraints on object models
python -m pip install "besser[ocl]"
# pygit2, for generator.regenerate() (a model change that keeps your edits)
python -m pip install "besser[regen]"
# Django, for the Django generator
python -m pip install "besser[django]"
# The Docker SDK, for the DockerHub build and push of BackendGenerator
python -m pip install "besser[docker]"
# PostgreSQL, MySQL, Oracle and SQL Server drivers, to run generated apps
# against those databases from the same environment
python -m pip install "besser[db]"
# pytest, to run the test suite of a source checkout
python -m pip install -e ".[dev]"
Extras combine: pip install "besser[agents,django]".
Changed in version 8.7.0: pytest, Django, docker, bocl, tiktoken, uvicorn, python-multipart and the database drivers are no longer part of the base install; install the matching extra above. The editor backend’s requirements file still includes all of them. PyYAML joined the base install: the Docker Compose generator needs it.
The hosted editor backend has its own requirements. Its runtime setup is covered by Contributor Guide and the editor’s local deployment guide.
If installation fails, check Troubleshooting and include the Python version and complete install error when reporting an issue.