Installation¶
Installing BendersLib¶
Tip
If you are new to Python, we recommend using conda
as your package and environment manager.
By default, conda will install pip in the created environments, so you can use either pip or conda
to install BendersLib (and other packages).
BendersLib was written in pure Python, you can easily install it via pip or conda.
Environment Setup (optional)¶
To avoid potential dependency conflicts, it is recommended to create a new conda environment
for BendersLib before installing it.
# Create a new conda environment named "bendersenv" with Python 3.9 or higher
conda create -n bendersenv python=3.9
# Activate the new environment
conda activate bendersenv
Installing BendersLib¶
Caution
BendersLib requires Python 3.10 or higher.
python --version
# Should be Python 3.10 or higher
pip install benderslib
# Upgrade to the latest version
pip install benderslib --upgrade
# Install from PyPI using uv
uv pip install benderslib
# Upgrade to the latest version
uv pip install --upgrade benderslib
Verifying the Installation¶
To verify that BendersLib has been installed correctly, you can run the following code:
import benderslib as bd
print("BendersLib version:", bd.__version__)
If you see the version number printed without any errors, the installation was successful.
Installing Solvers¶
# Install only needed solvers
pip install "benderslib[copt]"
pip install "benderslib[cplex]"
pip install "benderslib[cplexcp]"
pip install "benderslib[gurobi]"
pip install "benderslib[ortools]"
pip install "benderslib[pyomo]"
pip install "benderslib[scip]"
# Install all supported solvers
pip install "benderslib[all-solvers]"
Attention
BendersLib will NOT install any solver to your environment automatically. You need to install the solvers separately based on your needs.
BendersLib supports several popular optimization solvers. You can install these solvers individually based on your needs. Installing all of them is not necessary. Please refer to Supported Solvers’ Features for solver features and license requirements
Solver |
pip |
conda |
Guide |
|---|---|---|---|
COPT |
|
N/A |
|
CPLEX |
|
|
|
CP Optimizer |
|
|
|
Gurobi |
|
|
|
OR-Tools |
|
N/A |
|
SCIP |
|
|
|
Pyomo [2]: |
|
|
|
CBC |
N/A |
|
|
CPLEX |
|
|
|
GLPK |
N/A |
|
|
Gurobi |
|
|
|
HiGHS |
|
|
|
MOSEK |
|
|
|
SCIP |
N/A |
|
|
Xpress |
|
|
Troubleshooting¶
To be added (common issues will be summarized here)…