Installation guide

The version 2.1 of the City Energy Analyst is dependent on ArcGIS 10.4 for its visuals. As such it is restricted to Windows-based OS’s for some features.

Installation on Windows

Installing the CEA on Windows is easiest with Anaconda (or Miniconda) as the CEA depends on the geopandas module.

Installation follows the following basic steps:

  1. create a conda environment and activate it (optional)
  2. conda install -c conda-forge geopandas
  3. pip install cityenergyanalyst
  4. cea install-toolbox (installs the CEA as an ArcGIS 10.4 toolbox)

The following subsections contain additional information for variations on the above theme.

Creating a conda environment

Creating a conda environment is an optional step, but probably a good habit to get into: This creates a python environment separate from your other python environments - that way, version mismatches between packages don’t bleed into your other work. Follow these steps to create a new conda environment for the CEA:

  1. conda create -n cea python=2.7 (you can use any name, when creating an environment - “cea” is just an example)
  2. activate cea (do this before any cea-related work on the commandline)
  3. work with CEA, python is now set up to use your conda environment
  4. deactivate cea (you can also just close the shell)

Connecting to Arcpy

The command cea install-toolbox (see step 4 in the basic installation steps above) attempts to connect the CEA with the ArcGIS environment. You should not need to do anything else.

If, however, you get error messages like ImportError: no module named arcpy you can check your home directory for a file called cea_arcgis.pth containing these three lines:

C:\Program Files (x86)\ArcGIS\Desktop10.4\bin
C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy
C:\Program Files (x86)\ArcGIS\Desktop10.4\Scripts

Edit these folders to point to the appropriate ArcGIS folders as documented in the ArcGIS manuals.

Installation from GitHub repository

If you’d prefer to track the newest version of the City Energy Analyst, replace step 3 in the basic installation steps above with a git clone of the CEA GitHub repository and run:

python setup.py install

to install the CEA, including the cea tool. Note, you will still need to follow the guide above to create a conda environment and install geopandas.

Installation of the development environment

When installing the City Energy Analyst for development, clone the repository to your computer and run:

python setup.py develop

This will install the cea tool to your path and set it up to use the version in the repository. Note, you will need to follow the guide above to create a conda environment and install geopandas.

Setting up PyCharm

The developer team uses PyCharm Community edition as default. Here are the instructions to get PyCharm up and running:

  1. Access PyCharm and open project CEAforArcGIS
  2. Open File>Settings>Project:CEAforArcGIS>Project Interpreter>Project Interpreter
  3. Click on settings>addlocal and point to the location of your python installation in the environment cea. It should be located in something like C:\Users\your_name\Anaconda2\envs\cea/python.exe
  4. Click apply changes and your are done!

To set the custom dictionary used in PyCharm, do:

  1. Open File>Settings>Editor>Spelling
  2. Open the Dictionaries tab
  3. Add a new Custom Dictionaries Folder
  4. Select the root source folder for CEAforArcGIS. It should be located in something like C:\Users\your_name\Documents\GitHub\CEAforArcGIS.
  5. Click “Apply”.

Installation on the Euler cluster

It is possible to install the CEA on the Euler cluster by following the following guide: Installing the City Energy Analyst on the Euler cluster.