Installation¶
optimex is available on PyPI and conda. Choose your preferred package manager below. In case you have an Apple Silicon Chip, you can directly jump to the platform-specific notes.
Quick Install¶
If you just want to get started quickly:
Detailed Installation¶
Using uv¶
uv is a fast, modern Python package manager written in Rust. It's significantly faster than pip and handles dependency resolution more reliably. Installing uv is a one-liner.
Create a new project with uv:
Run your scripts with:
Or directly get started in JupyterLab:
By default, juypter lab will start the server at http://localhost:8888/lab.
One-line optimex setup
For your convenience, we've prepared a setup script that initiates a new uv project and fetches our optimex example notebook, so you can directly get started. Just run:
Create and activate a new virtual environment:
Install optimex:
Using conda / mamba¶
Conda and mamba are popular in scientific computing. Mamba is a faster drop-in replacement for conda.
Create a new environment with optimex:
Or with mamba:
Using pip¶
The standard Python package manager.
Platform-Specific Notes¶
Apple Silicon (M1/M2/M3/M4)¶
Brightway and optimex run natively on Apple Silicon. However, the standard pypardiso solver used on Windows and Linux is not compatible with ARM processors. To achieve fast linear algebra calculations, you must use scikit-umfpack.
uv manages your Python environment efficiently, but you must first install the system-level SuiteSparse dependencies via Homebrew.
Install system dependencies:
Create project & add dependencies:
uv init my-project
cd my-project
# Adding optimex along with the ARM-compatible solver
uv add optimex scikit-umfpack
Run Jupyter (without adding to project)
When using pip, you must first install the system-level SuiteSparse dependencies via Homebrew.
Install system dependencies:
Install packages:
Conda is the most robust method for Apple Silicon because it handles the complex C-libraries (SuiteSparse) automatically without requiring Homebrew.
Optional Dependencies¶
Jupyter Support¶
For interactive notebooks:
Development Installation¶
To install from source for development:
Verifying Installation¶
Test that optimex is installed correctly:
Solver Requirements¶
optimex uses Pyomo for optimization, which requires a solver. By default, it uses Gurobi, but you can configure other solvers like GLPK, CBC, or HiGHS.
Gurobi License
Gurobi offers free academic licenses. Visit gurobi.com to obtain one.