We recommend using Anaconda, which bundles togther most of the required packages. NILMTK requires Python 3.6+ due to the module it depends upon.
If you prefer to avoid Anaconda, you could install most packages using
pip but you will require a compatible C compiler for your Python distribution. Be sure to use the package versions listed in the file
Before anything, install Anaconda. If you already have it installed, be sure to keep it updated.
The following instructions are general enough to work on Linux, macOS or Windows (run the commands on a Powershell session). Remember to adapt it to your environment.
- Install Git, if not available. On Linux, install using your distribution package manager, e.g.:
sudo apt-get install git
On Windows, download and installation the official Git client.
Alternatively, if you do not have administrator access, you can install Git directly on the Anaconda distribution running
conda install git.
- Download NILMTK:
cd ~ git clone https://github.com/nilmtk/nilmtk.git cd nilmtk
The next step creates a separate environment for NILMTK (see the Anaconda documentation), using NILMTK's
environment-dev.yml text file to define which packages need to be installed. If you have a previous
nilmtk-env environment, please remove it first (
conda env remove -n nilmtk-env).
conda env create -f environment-dev.yml conda activate nilmtk-env
Next we will install nilm_metadata (for development, we recommend installing from the repository, even though there is a conda package available):
cd ~ git clone https://github.com/nilmtk/nilm_metadata/ cd nilm_metadata python setup.py develop cd ..
Change back to your nilmtk directory and install NILMTK:
cd ~/nilmtk python setup.py develop
Run the unit tests:
Then, work away on NILMTK! When you are done, just do
conda deactivate to deactivate the nilmtk-env (or just clone the terminal/session).