Compiling Matplotlib with TkAgg and pip

Normally we install precompiled Matplotlib via

conda install matplotlib

If you need/choose to upgrade Matplotlib via pip and need TkAgg:

sudo apt install tk-dev libpng-dev libffi-dev dvipng texlive-latex-base

pip install cairocffi

pip install --upgrade matplotlib