美文网首页
Mac RuntimeError: Unable to “imp

Mac RuntimeError: Unable to “imp

作者: izhangxm | 来源:发表于2017-09-03 14:49 被阅读0次
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. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ
cd ~/.matplotlib
nano matplotlibrc
# add content
backend: TkAgg

或者
Here is a sample python snippet that you can try and test matplotlib.

import matplotlib

matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

plt.plot([1, 2, 3], [0, 3, 7])
plt.show()

参考:
https://stackoverflow.com/questions/29433824/unable-to-import-matplotlib-pyplot-as-plt-in-virtualenv

相关文章

网友评论

      本文标题:Mac RuntimeError: Unable to “imp

      本文链接:https://www.haomeiwen.com/subject/qgfuqxtx.html