问题
I'm using an AWS cluster EMR 5.3.1 with Hadoop + Spark + Hive + Zeppelin
When I use Zeppelin and type command:
%python
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
I get error:
ImportError: Gtk3 backend requires pygobject to be installed.
How to solve it?
回答1:
Before importing pyplot
module you need to change matplotlib's backend to Agg
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
来源:https://stackoverflow.com/questions/42481911/amazon-emr-cluster-matplotlib-error