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拷贝 ...
随机推荐
- java集合类中的迭代器模式
不说模式的问题,看一个<<设计模式之禅>>里面的例子. 老板要看到公司了各个项目的情况.(我知道我这个概述很让人头大,看代码吧) 示例程序 v1 package Iterato ...
- 二分算法C实现
#include <stdio.h> #include <stdlib.h> #define NR(x) (sizeof(x)/sizeof(x[0])) int Binary ...
- LeetCode之旅(18)-Happy Number
题目 Write an algorithm to determine if a number is "happy". A happy number is a number defi ...
- rails常用命令备忘
rails new xxx 创建一个新rails项目 rails generate scaffold xxx 创建表模型,视图,控制器和迁移的"脚手架" rake db:migra ...
- Java IO学习--(四)网络
Java中网络的内容或多或少的超出了Java IO的范畴.关于Java网络更多的是在我的Java网络教程中探讨.但是既然网络是一个常见的数据来源以及数据流目的地,并且因为你使用Java IO的API通 ...
- 关于linux防火墙
1.防火墙是什么:防火墙就是用于实现Linux下访问控制的功能的,它分为硬件的或者软件的防火墙两种.无论是在哪个网络中,防火墙工作的地方一定是在网络的边缘.而我们的任务就是需要去定义到底防火墙如何工作 ...
- G1 GC技术解析
介绍 G1 GC,全称Garbage-First Garbage Collector,通过-XX:+UseG1GC参数来启用.G1收集器是工作在堆内不同分区上的收集器,分区既可以是年轻代也可以是老年代 ...
- 细说Web页面与本地电脑通讯
话说在很久很久以前.Web页面与客户的本地电脑Localhost通讯,有两种方式: 1.Flash 2.ActiveX控件 由于Flash本人不是很了解,也给出不了什么示例代码, 对于ActiveX控 ...
- 如何在asp.net mvc 中使用Autofac 控制反转(Ioc)
前言 最近看了一些关于Ioc方面的开源项目,里面的类跳来转去,看的迷迷糊糊的.项目里根本不需要这么“复杂的”设计,只需简单完成Ico,达到解耦的目的,并且能高效的完成项目.于是参考autofac的官网 ...
- Thinkphp3.2简单解决多文件上传只上传一张的问题
html简单页面: index.html代码: <form action="{:U('index/upload')}" method="post" enc ...