The filename argument is a string, and should be in quotes:
myImage = Image.open("green_leaves.jpg")
Without the quotes, Python looks for the attribute jpg
of the object referenced by name green_leaves
, which does not exist; hence the NameError
.