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#
Install
pythonfrom 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.:
python -m venv C:/Users/me/virtualenvs/brightway
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
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.
Install
pythonfrom Homebrew.Install the requirements for
SuiteSparseviahomebrew:
brew install swig suite-sparse
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
Create and activate a virtualenv:
python -m venv virtualenvs/brightway
source virtualenvs/brightway/bin/activate
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
A working installation of
condaormamba. 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 (brightway25_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 brightway25 scikit-umfpack numpy">=2" scikit-umfpack">=0.4.2"
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