mac系统,安装了matplotlib之后, 导入matplotlib.pyplot的时候报错

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 using (Ana)Conda
please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ
for more information.

说python不是作为框架安装的,从stackoverflow上面找到的解决办法,现记录一下
1. cd ~/.matplotlib

2. nano matplotlibbrc
3. 在打开的文件里加一行: backend : TkAgg

nano编辑器的使用:ctrl + x 保存退出, y确认保存,回车退出

4. 在python里,使用matplotlib.pyplot之前先执行以下两行代码:

In [1]: import matplotlib

In [2]: matplotlib.use("TkAgg")

然后再导入,import matplotlib.pyplot as plt

it works!

最新文章

  1. android 数据下载 工具类
  2. 为 WSUS 服务器定期运行清理向导
  3. 更换VS2012序列号的方法
  4. 嵌入式 uboot、fs、kernel制作和烧录简记-hi3518c
  5. UVa1449 - Dominating Patterns(AC自动机)
  6. WPF RichTextBox滚动条自动滚动实例、文本自动滚动实例
  7. SPOJ104 Highways,跨越数
  8. Apache HttpServer Installing the apache2.2 service <OS 5>拒绝访问. :Failed to open the WinNT service manager
  9. github提交代码失败
  10. MVP架构分析与搭建
  11. js实现页面遮罩层,并且阻止页面body滚动
  12. [原]Jenkins(三)---Jenkins初始配置和插件配置
  13. c#中base64编码解码
  14. leecode第一百三十六题(只出现一次的数字)
  15. leaflet-velocity 参数
  16. datatables分页
  17. 批处理系列(13) -从视频导出高质量GIF图片
  18. iOS边练边学--触摸事件以及能够拖拽的UIView的练习
  19. Spring 4 + Hibernate 4 下 getCurrentSession()的使用情况
  20. wpf数据绑定更新通知

热门文章

  1. 【CodeBase】通过层级键在多维数组中获取目标值
  2. thinkphp 3.2.3 程序执行时序图
  3. PHP跨域请求nodejs
  4. java 调用第三方系统时的连接代码-记录
  5. Oracle两种临时表的创建与使用详解
  6. pandas知识点(汇总和计算描述统计)
  7. UVA_1025 a Spy in the Metro 有向无环图的动态规划问题
  8. 子窗体与父窗体调用对方js方法
  9. oracle 11g 版本自带移除,省时省力
  10. 3 View视图 URLconf