虚拟环境无法使用matplotlib问题

在python虚拟环境下直接使用matplotlib会报错

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.

安装完matplotlib的后会新建一个文件夹~/.matplotlib。

在该文件夹里面新建一个matplotlibrc文件,往里面写:
backend: TkAgg

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文为《爬着学Python》系列第十三篇文章。 Python能在这几年火起来,靠的不是网上一大片的爬虫和服务器后端...
    SyPy阅读 10,314评论 0 5
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,935评论 25 709
  • 22年12月更新:个人网站关停,如果仍旧对旧教程有兴趣参考 Github 的markdown内容[https://...
    tangyefei阅读 35,290评论 22 257
  • 时序图(Sequence Diagram)是显示对象之间交互的图,这些对象是按时间顺序排列的。顺序图中显示的是参与...
    白书黑影阅读 6,372评论 0 0
  • 你们看手机都是正事,他这样说,然后就去房间了。他说去睡觉。晚上七点不到。智能手机使我们失去了什么。大家共处一屋,手...
    藕节节阅读 988评论 0 0