matplotlib使用时报错RuntimeError: Python is not installed as a framework(一)
笔者在第一次安装matplotlib后运行时出现报错。
import matplotlib as mlb from matplotlib import pylab as pl x = [1,3,5,7,6,9,10,13,16] y = [3,4,5,7,9,0,1,2,3] pl.plot(x,y) pl.show()
报错内容
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.
解决方法:
1、 打开终端,输入cd ~/.matplotlib
2、新建文件,vi matplotlibrc
3、文件中添加内容,按下i键,然后输入内容 backend: TkAgg ,然后点击esc,输入:号,输入wq,然后回车确定
4、重新运行脚本
结果如下:
matplotlib使用时报错RuntimeError: Python is not installed as a framework(一)的更多相关文章
- RuntimeError: Python is not installed as a framework 错误解决方案
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题: >>> import matplotlib.pyplot as pltTraceback (most r ...
- 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 infor
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题: >>> import matplotlib.pyplot as pltTraceback (most r ...
- RuntimeError: Python is not installed as a framework.
RuntimeError: Python is not installed as a framework. 文章转载:https://www.cnblogs.com/harelion/p/563776 ...
- RuntimeError: Python is not installed as a framework 错误解决办法
因为我是macbook,mac是自带的python 2.7,但是我开发需要使用到的是python3,所以先使用pip3 install matplotlib 然后在交互页面键入import matpl ...
- 出现ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly ....的解决方法
在terminal上运行gluoncv时遇到了一个报错问题. ImportError: Python is not installed as a framework. The Mac OS X bac ...
- ssh调用matplotlib绘图报错RuntimeError: Invalid DISPLAY variable
1.问题:在本地用matplotlib绘图可以,但是在ssh远程绘图的时候会报错 RuntimeError: Invalid DISPLAY variable 2.原因:matplotlib的默认ba ...
- matplotlib 绘图报错 RuntimeError: Invalid DISPLAY variable
ssh 远程登录 Linux 服务器使用 matplotlib.pyplot 绘图时报错 原因: matplotlib 在 windows 下的默认 backend 是 TkAgg:在 Linux 下 ...
- 解决async 运行多线程时报错RuntimeError: There is no current event loop in thread 'Thread-2'
原来使用: loop = asyncio.get_event_loop()task = asyncio.ensure_future(do_work(checker))loop.run_until_co ...
- 解决:Elipse配置Jython Interpreters时报错Error: Python stdlib source files not found
今天学习lynnLi的博客monkeyrunner之eclipse中运行monkeyrunner脚本之环境搭建(四)时,遇到了一个问题,即: lynnLi给出的解决办法是:将Python下的Lib拷贝 ...
随机推荐
- OpenCV——PS 图层混合算法 (三)
具体的算法原理可以参考 PS图层混合算法之三(滤色, 叠加, 柔光, 强光) // PS_Algorithm.h #ifndef PS_ALGORITHM_H_INCLUDED #define PS_ ...
- 如何编写 PL/SQL 程序
本文的操作选用的数据库是oracle 数据库,登陆的用户是自带的scott用户,默认密码:tiger,有不懂得可以相互讨论一下,谢谢. 首先需要了解PL/SQL块的结构,PL/SQL块由定义部门.执行 ...
- Validate Binary Search Tree(一定掌握的方法)
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...
- Spring消息之STOMP
一.STOMP 简介 直接使用WebSocket(或SockJS)就很类似于使用TCP套接字来编写Web应用.因为没有高层级的线路协议(wire protocol),因此就需要我们定义应用之间所发送消 ...
- Future与Promise
https://code.csdn.NET/DOC_Scala/chinese_scala_offical_document/file/Futures-and-Promises-cn.md#ancho ...
- Triangle (第8届山东省赛的某题)
triangle(第8届山东省赛的某题) 传送门 题意:喵了个呜,这题意真是峰回路转啊.懒死了,不想描述. 做法:我们拿set或线段树维护exp的最小值,每次取出exp值最小的边,删除之.并更新这条边 ...
- Java并发-任务执行
大多数的应用程序都是围绕"任务执行"来构造的:任务常常是一些抽象的并且离散的工作单元.我们把应用程序的工作分解到多个任务中,可以简化程序的组织结构,提供一种自然的事物便捷来优化错误 ...
- PHP采用Cookie实现 购物车
先来看一下逻辑分析图:
- “蝉原则”与CSS3随机多背景随机圆角等效果
一.什么是“蝉原则”? “蝉原则”,英文称作“cicada principle”,是一种让事物的重复出现符合“自然随机性”的规则,为什么这么说呢? “蝉原则”源自于北美,中国似乎并未有这样的说法,这背 ...
- 代码生成平台Xxl-Code-Generator
<代码生成平台Xxl-Code-Generator> 一.简介 1.1 概述 Xxl-Code-Generator 是一个 "controller/service/dao/myb ...