Source

brightway2 / docs / installation.rst

Installation

Windows

Although Brightway2 is relatively simple, installation of the numerical and scientific libraries can be difficult as there is no default compilers installed on most Windows machines. The only sensible way is to use a precompiled set of packages, such as Python (x,y) or the Enthought Python Distribution. If using Python (x,y), be sure to install lxml separately.

If you are stubborn and/or brave, you can try to install Python, NumPy, SciPy and lxml by yourself. The are various compiled binaries for each of these packages available at various places around the net. You should also install pip.

After the basic installation, you can install all additional Brightway2 packages and dependencies in one command in the command shell:

pip install bw2all

If you want to develop with Brightway, then don't install the metapackage. Instead, first install virtualenv and virtualenv for Powershell:

pip install virtualenv virtualenvwrapper-powershell
mkvirtualenv bw2 --system-site-packages

Before you do anything else, go back and read what virtualenv does :) Now you can install packages into your isolated environment:

pip install progressbar flask docopt voluptuous requests bw-stats-toolkit nose sphinx
pip install -e hg+https://bitbucket.org/cmutel/brightway2#egg=brightway2
pip install -e hg+https://bitbucket.org/cmutel/brightway2-calc#egg=bw2calc
pip install -e hg+https://bitbucket.org/cmutel/brightway2-ui#egg=bw2ui
pip install -e hg+https://bitbucket.org/cmutel/brightway2-analyzer#egg=bw2analyzer

Max OS X

There are two main alternatives for installing packages on OS X: Macports and Homebrew. Brightway2 is developed primarily on OS X using Macports, but as it depends on a few standard libraries, either alternative should work well. Homebrew users will have to adapt the following instructions.

Follow the instructions and install Macports. Note that both Macports and Homebrew require Xcode to be installed first.

Next, install the needed Python libraries using this command in the Terminal:

sudo port install py27-scipy py27-numpy py27-pip py27-progressbar py27-libxml2

To only work with Brightway2, finish your installation using another Terminal command:

sudo pip install bw2all

If you want to develop with Brightway, then don't install the metapackage. Instead, we will create a virtualenv for the Brightway2 dependencies and framework. First, read what virtualenv does; then, run the following in a Terminal:

sudo port install virtualenv virtualenvwrapper py27-cython py27-nose py27-sphinx py27-flask py27-requests
mkvirtualenv bw2 --system-site-packages
pip install docopt voluptuous bw-stats-toolkit
pip install -e hg+https://bitbucket.org/cmutel/brightway2#egg=brightway2
pip install -e hg+https://bitbucket.org/cmutel/brightway2-calc#egg=bw2calc
pip install -e hg+https://bitbucket.org/cmutel/brightway2-ui#egg=bw2ui
pip install -e hg+https://bitbucket.org/cmutel/brightway2-analyzer#egg=bw2analyzer

Linux

General instructions are provided for Ubuntu; people using other distributions are assumed smart to be enough to adapt as necessary. See also Platform-agnostic instructions above.

First, install the required apt packages. You can select them in the graphical interface, or through one command in the terminal:

sudo apt-get install python-scipy python-numpy python-nose python-pip python-progressbar python-libxml2 python-sphinx python-virtualenv python-virtualenvwrapper

Then install Brightway2 using another terminal command:

sudo pip install bw2all

If you want to develop with Brightway, then don't install the metapackage. Instead, we will create a virtualenv for the Brightway2 dependencies and framework. First, read what virtualenv does; then, run the following in a Terminal:

mkvirtualenv bw2 --system-site-packages
pip install docopt voluptuous bw-stats-toolkit flask requests
pip install -e hg+https://bitbucket.org/cmutel/brightway2#egg=brightway2
pip install -e hg+https://bitbucket.org/cmutel/brightway2-calc#egg=bw2calc
pip install -e hg+https://bitbucket.org/cmutel/brightway2-ui#egg=bw2ui
pip install -e hg+https://bitbucket.org/cmutel/brightway2-analyzer#egg=bw2analyzer

Platform-agnostic

Installation of Brightway2 has two steps. First, install the following scientific and numeric libraries:

  • scipy >= 0.10
  • numpy >= 1.6
  • lxml
  • pip

Warning

Make sure that SciPy builds with support for UMFPACK; you may need to also install scikits-umpack.

Second, install the Brightway2 metapackage:

pip install bw2all

If you want to install packages manually, or not install everything, Brightway2 uses the following Python packages:

  • progressbar
  • flask
  • docopt
  • voluptuous
  • requests
  • bw-stats-toolkit

The Brightway2 packages are:

  • brightway2
  • bw2calc
  • bw2ui
  • bw2analyzer

If you want to develop with Brightway, then you should install the following:

  • nose
  • sphinx

Warning

If you are developing, it is strongly recommended to use virtualenv and virtualenvwrapper.