2017-11-24T10:27:44Z||2017-11-24T10:27:44Z


完整的错误消息:

**RuntimeError**: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends.

解决方案,加上这两句:

import matplotlib as mpl
mpl.use('TkAgg')