A step-by-step manual for installing NILMTK and TensorFlow

2 minute read


In this manual, we explain how to install NILMTK based on sources from NILMTK User Guide and NILMTK Documentation. We thank Nipun Batra and Paulo Meira for providing such useful information on Github.

Install Conda

Before downloading NILMTK, you need to install a proper development environment. We propose the use of Conda:

With over 6 million users, the open source Anaconda Distribution is the easiest way to do Python data science and machine learning. It includes hundreds of popular data science packages and the conda package and virtual environment manager for Windows, Linux, and MacOS. Conda makes it quick and easy to install, run, and upgrade complex data science and machine learning environments like Scikit-learn, TensorFlow, and SciPy. Anaconda Distribution is the foundation of millions of data science projects as well as Amazon Web Services’ Machine Learning AMIs and Anaconda for Microsoft on Azure and Windows.

Download Anaconda for Python 3.6 here.

In order to install Anaconda, run the installation in the command line:

cd Downloads/
sudo bash Anaconda3-5.2.0-Linux-x86_64.sh -u

This will initiate the installation process, which will guide you through the several steps. Install Conda and test the installation by executing the command conda in the command prompt.

Bad Interpreter: No such file or directory

In case the command conda results in an error, apply the following fix:

cd /home/user/
nano .bashrc

add the line: export PATH=~/anaconda3/bin:$PATH

Finally, execute the command:

source .bashrc

Before you proceed any further, check if you have GIT installed on your machine. If it’s missing, install it:

sudo apt-get install git

NILMTK in User Mode

Create NILMTK environment in Conda.

In the first step, download NILMTK YML file

Open the command prompt and execute:

cd downloads/
conda env create -f=nilmtk.yml

Alternatively, open Anaconda Navigator:

Create Jupyter kernel env

Run the following command in the prompt:

source activate nilmtk-env
python -m ipykernel install --user --name nilmtk-env --display-name "Python (nilmtk)"

Now you are ready to go!

Optional: PyCharm IDE

In development environments such as PyCharm, you should be able to integrate nilmtk-env now.

NILMTK in Developer Mode

In case you want to modify or extend NILMTK, it might be beneficial to install the toolkit in developer mode.

On Ubuntu, please install the following packages:

sudo apt-get install python3-tk python-pyqt5

Download NILMTK via git:

git clone https://github.com/nilmtk/nilmtk.git

Install the Anaconda environment by

conda env create
source activate nilmtk-env

Proceed with installing nilm_metadata:

git clone https://github.com/nilmtk/nilm_metadata/
cd nilm_metadata
python setup.py develop
cd ..

Finally, install nilmtk

cd nilmtk/
python setup.py develop

Check if your installation works fine by the help of unit tests:



Activate your Conda environment:

source activate nilmtk-env

For Python 3.6 with GPU support:

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.10.1-cp36-cp36m-linux_x86_64.whl
pip install keras

To be extended…

We will frequently update and extend this manual…