【Python】Macbook Pro MacOS Sierra 无法加载 matplotlib.pyplot 解决办法
2017-06-17 22:58
639 查看
错误提示内容:
找到两种解决办法,第一方法我用不好使,第二个方法我用好使。
第一种方法:
转自:https://github.com/matplotlib/matplotlib/issues/2919
第二种方法:
转自:https://stackoverflow.com/questions/29433824/unable-to-import-matplotlib-pyplot-as-plt-in-virtualenv
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 114, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 24, in <module> from matplotlib.backends import _macosx 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 fc-list老外说会运行10到15分钟,所以如果上面命令可行就耐心等一等。反正这个方法对我没用。
转自:https://github.com/matplotlib/matplotlib/issues/2919
第二种方法:
cd ~/.matplotlib nano matplotlibrc添加内容:
backend : Agg按Shift + C,按Y,按回车退出。
转自:https://stackoverflow.com/questions/29433824/unable-to-import-matplotlib-pyplot-as-plt-in-virtualenv
相关文章推荐
- python matplotlib plot 数据中的中文无法正常显示的解决办法
- python matplotlib plot 数据中的中文无法正常显示的解决办法
- python的matplotlib画图时无法显示中文的解决方法
- Windows7下Python安装Numpy、Matplotlib以及Scipy时出现的问题以及解决办法
- python 1: 解决linux系统下python中的matplotlib模块内的pyplot输出图片不能显示中文的问题
- Python Matplotlib图表汉字显示成框框的解决办法
- [python] matplotlib中文乱码解决办法
- python2.7之matplotlib中plt.show()不显示图的解决办法
- Python在Mac上运行matplotlib出错:RuntimeError: Python is not installed as a framework.解决办法
- 不同版本中Python matplotlib.pyplot.draw()界面绘制异常问题的解决
- Python使用matplotlib绘图无法显示中文问题的解决方法
- Python中matplotlib中文乱码解决办法
- 解决mac上matplotlib(plot)无法显示中文的问题 (Python)
- python3+nltk3+matplotlib1.3中plot方法无法执行的解决办法
- python 使用matplotlib绘图中文显示成框框解决办法
- [完]Python 安装setuptools,解决使用Matplotlib遇到的问题
- python: 使用matplotlib的pyplot绘制图表
- 怎么解决numpy和matplotlib无法安装问题
- Windows7安装numpy、scipy和matplotlib时遇到的问题及解决办法
- ubuntu 下在 matplotlib 中正常显示中文的解决办法