If you are using Linux as your OS then you can follow the below-mentioned steps:-
Firstly, remove matplotlib==1.3.1 from requirements.txt
After that try to install it with sudo apt-get install python-matplotlib
Run pip install -r requirements.txt (Python 2), or pip3 install -r requirements.txt (Python 3)
pip freeze > requirements.txt
If you are using Windows as your OS then use the following steps:-
python -m pip install -U pip setuptools
python -m pip install matplotlib