Import Error in time sequence prediction example in AWS NVIDIA Volta DL AMI

I am running NVIDIA Volta Deep Learning AMI at AWS.I want to try example “time sequence prediction” in /opt/pytorch/examples/time_sequence_prediction. I got the following error:

root@7c22d5c7376f:/opt/pytorch/examples/time_sequence_prediction# python generate_sine_wave.py
root@7c22d5c7376f:/opt/pytorch/examples/time_sequence_prediction# python train.py
Traceback (most recent call last):
File “train.py”, line 7, in
import matplotlib
ImportError: No module named ‘matplotlib’

I succeeded at running mnist example’s main.py.