Skip to content
silviana amethyst edited this page May 12, 2026 · 6 revisions

Ideal install process

From PyPI

Just install from PyPI.

pip install bertini2

We did a TON of work to pre-compile wheels with dependencies, so this SHOULD work. It was first released into the wild in May 2026. If it doesn't work, please raise an issue.

Other package managers

We're working on it. First, PyPI.


Building from source

These instructions assume you have CMake, a modern C++ compiler.

  • Bertini 2 is developed on MacOS and Linux. We also have it working on Windows at this point, with dependencies resolved by Micromamba or similar package manager. On Windows, it works with Python 3.11 and before. We're working on later versions.

First, install dependencies, clone the repo

  1. Use a package manager to install relevant packages.

    • We recommend Mamba or Micromamba because they have all of the packages in one spot with the right versions, and they're free
    • Homebrew on MacOS makes these things kinda easy, too. Using both Homebrew AND Mamba at the same time on MacOS is kinda tricky to get the environment variables right. I suggest you choose one.

    a. With mamba: mamba create -n b2 && mamba activate b2, mamba install gmp mpfr mpc cmake boost eigen eigenpy libboost-python numpy. Your system also needs the build-essential package, it is likely installed by default.

    b. With another packager manager: $PACKAGE_MANAGER install gmp mpfr mpc cmake boost eigen boost-python3 build-essential, pip install numpy. If you're using apt, then you need the *-dev or -dev-all versions of some of these packages.

  2. Clone and move in. git clone https://github.com/bertiniteam/b2, then cd b2.

Second, install from top level using pip

  1. pip install .

This should pick up any additional requirements and compile the library, installing everything in the right place (site-packages). TO speed things up, might I recommend running first:

export MAKEFLAGS="-j8"

Development building with editable install

With pip install --no-build-isolation -e ., instead of copying the .so to site-packages, Python is told to look in your local build directory. So the workflow becomes:

  1. pip install --no-build-isolation -e . — once, sets everything up, builds into bld
  2. Change C++ code
  3. cmake --build bld — recompile
  4. In Python, import bertini2 — picks up new .so immediately

Clone this wiki locally