Installation#

Brightway can be installed using the Python package installer pip or the multi-language package management system conda and its friend mamba.

Note

Brightway supports Python >=3.9. This guide is for the current stable Brightway 2.5 release; see the difference between brightway2 and brightway 25.

Installing Brightway using pip#

  1. Install python from the website, your system package manager, or Homebrew.

  2. Create a directory for your virtual environments, such as C:/Users/me/virtualenvs/

  3. In a console or terminal window, create a new virtual environment.:

python -m venv C:/Users/me/virtualenvs/brightway
  1. Activate the virtual environment. The exact syntax depends on your operating system; it will look something like:

source C:/Users/me/virtualenvs/brightway/bin/activate
  1. Install Brightway:

pip install brightway25 pypardiso

Note that brightway25 is just an easy way to install libraries; it doesn’t provide any functionality, and you shouldn’t import it in Python scripts.

You can also use pip to install useful libraries like jupyterlab.

Note

Fast calculations need SuiteSparse through scikit-umfpack. This background library can be installed via homebrew, as shown in this section, or via conda or mamba, as shown below.

  1. Install python from Homebrew.

  2. Install the requirements for SuiteSparse via homebrew:

brew install swig suite-sparse
  1. In a terminal window, create a directory for your virtual environments. This can be anywhere; we will use the home directory here as an example:

cd
mkdir virtualenvs
  1. Create and activate a virtualenv:

python -m venv virtualenvs/brightway
source virtualenvs/brightway/bin/activate
  1. Install Brightway:

pip install brightway25 scikit-umfpack

Note that brightway25 is just an easy way to install libraries; it doesn’t provide any functionality, and you shouldn’t import it in Python scripts.

You can also use pip to install useful libraries like jupyterlab.

Installing Brightway using conda or mamba#

Prerequisites

  1. A working installation of conda or mamba. If you are using conda, we recommend installing the libmamba solver.

  2. Basic knowledge of Conda environments

  1. Create a new Conda environment (in this example named brightway):

conda create -n brightway -c conda-forge -c cmutel brightway25
  1. Activate the environment:

conda activate brightway
  1. (Optional but recommended) You can also use conda to install useful libraries like jupyterlab:

conda install -c conda-forge jupyterlab

Note

Brightway runs on the new Apple Silicon ARM architecture. However, the super-fast linear algebra software library pypardiso is not compatible with the ARM processor architecture. To avoid critical errors during instruction that would break core functionality, a different version of Brightway (brightway25_nosolver) and a a different linear algebra software library (scikit-umfpack) must be installed.

  1. Create a new Conda environment (in this example named brightway):

conda create -n brightway -c conda-forge brightway25 scikit-umfpack numpy">=2" scikit-umfpack">=0.4.2"
  1. Activate the environment:

conda activate brightway
  1. (Optional but recommended) You can also use conda to install useful libraries like jupyterlab:

conda install -c conda-forge jupyterlab