Notebook to py script issue: No module named PyQt4

Hi,

I would like to be able to run all the code in a notebook in a python script. I am having problems running a python file based on a working python notebook. The notebook runs fine in the same AWS instance.

Here are the details:

I have setup aws instance as described in lessons 1. I create a python notebook and it runs without any problems.
I then convert the notebook to py script:

jupyter nbconvert --to script vgg16_hydrangea.ipynb

I try to run this script with python, but it looks like it is missing a module named PyQt4. Any suggestions? I feel like this is something very simple, but I am new to python so not sure about all the dependencies. thanks for the help.

python vgg16_hydrangea.py

Traceback (most recent call last):
File “vgg16_hydrangea.py”, line 16, in
from matplotlib import pyplot as plt
File “/home/ubuntu/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.py”, line 114, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File “/home/ubuntu/anaconda2/lib/python2.7/site-packages/matplotlib/backends/init.py”, line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File “/home/ubuntu/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py”, line 16, in
from .backend_qt5 import QtCore
File “/home/ubuntu/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py”, line 31, in
from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, version
File “/home/ubuntu/anaconda2/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py”, line 137, in
from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4