Installation#
Brightway is a Python software package. A user interface is available, but not necessary for use. 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.8. This guide is for the current stable Brightway release (2.5); Activity-browser users should use the legacy Brightway 2 version Basic. See the difference between brightway2
and brightway 25
.
Installing Brightway using pip
#
Install
python
from the website, your system package manager, or Homebrew.Create a directory for your virtual environments, such as
C:/Users/me/virtualenvs/
In a console or terminal window, create a new virtual environment. Note that command must be executed in parent directory of your virtual environments directory, e.g.
C:/Users/me/
in our example above:
python -m venv virtualenvs/brightway
Activate the virtual environment. The exact syntax depends on your operating system; it will look something like:
source virtualenvs/brightway/bin/activate
Install Brightway:
pip install brightway25 pypardiso
(Optional) You can also use pip to install useful libraries like
jupyterlab
.
Note
If you are a beginner it’s easier to install Brightway via conda
on Apple Silicon.
brew install swig suite-sparse
Create a directory for your virtual environments. This can be anywhere; we will use the home directory here as an example:
cd
mkdir virtualenvs
Create and activate a virtualenv:
python -m venv virtualenvs/brightway
source virtualenvs/brightway/bin/activate
Note: You might need to specify the python version, like python3.11
.
Create a configuration file to help scikit-umfpack build correctly. This can be called anything (with a
.ini
extension); we will usecustom-config.ini
. Add the following to that file:
[properties]
umfpack-libdir = '/opt/homebrew/Cellar/suite-sparse/7.6.0/lib/'
umfpack-includedir = '/opt/homebrew/Cellar/suite-sparse/7.6.0/include/suitesparse/'
Install
scikit-umfpack
:
pip install scikit-umfpack -Csetup-args=--native-file=$PWD/custom-config.ini
This assumes that the custom-config.ini
file is in your current working directory.
Install Brightway:
pip install brightway25 pypardiso
(Optional) You can also use pip to install useful libraries like
jupyterlab
.
Installing Brightway using conda
or mamba
#
Prerequisites
A working installation of
conda
ormamba
. If you are usingconda
, we recommend installing the libmamba solver.Basic knowledge of Conda environments
Create a new Conda environment (in this example named
brightway
):
conda create -n brightway -c conda-forge -c cmutel brightway25
Activate the environment:
conda activate brightway
(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 (brightway_nosolver
) and a a different linear algebra software library (scikit-umfpack
) must be installed.
Create a new Conda environment (in this example named
brightway
):
conda create -n brightway -c conda-forge -c cmutel brightway25_nosolver scikit-umfpack
Activate the environment:
conda activate brightway
(Optional but recommended) You can also use conda to install useful libraries like
jupyterlab
:
conda install -c conda-forge jupyterlab
Updating Brightway#
Brightway is being actively developed, with frequent new releases. To update Brightway using pip
, activate your virtual environment, and run:
pip install -U brightway25
To update Brightway using conda
or mamba
, activate your environment, and run:
conda update -c conda-forge -c cmutel brightway25
Warning
Apple Silicon users should update brightway25_nosolver
.
Warning
Newer versions of Brightway can introduce breaking changes. We recommend you create a new environment for each project, and only update Brightway when you are ready to update your project.