出现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 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.
解决方法
- 如果你直接import Matplotlib了那么直接在import中添加如下代码:
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
- 如果你的import中有某些模块间接import了Matplotlib,那么找到site-package这个文件夹,一般来说这个文件夹在本目录下,要么在python的安装目录下,要么就要conda的目录下,在这个文件中找到.matplotlib/matplotlibrc,在文件末尾添加
backend: TkAgg
即可。
原因
个人猜测是macos不支持一些奇怪的窗口框架,所以只能修改为TK的。
出现ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly ....的解决方法的更多相关文章
- 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 ...
- 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 ...
- 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.
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 ...
- Python和Ruby抓取网页时的中文乱码问题(在Eclipse和Apatana Studio下均是这种解决方法
Python抓取中文网页乱码 :Eclipse+pydev2.2+python2.7 :Apatana Studio3+ pydev2.2+python2.7 run时设置 run--&g ...
- python读文件出现错误解决方法
python读文件经常会出现 UnicodeDecodeError: 'gbk' codec can't decode byte 0xbd in position 764: illegal multi ...
- Windows下运行python脚本报错“ImportError: No Module named ...”的解决方法
之前遇到一个问题,在Pycharm或IPython之类的IDE上运行脚本正常,但是直接运行或cmd命令行运行的时候报了模块未能找到的错误--ImportError: No Module named . ...
- Python ImportError: No module named 'requests'解决方法
前言:最近在学习python,安装了python3.5的环境后,在网上下载了一个python文件运行的时候,提示ImportError: No module named 'requests'(找不到r ...
随机推荐
- devops与CICD
前言 devops的概念已经在前一章已经说过了,下面介绍CICD的概念. CI(Continuous Integration,持续集成) 持续集成中,开发人员将会频繁地向主干提交代码,这些新提交的代码 ...
- SpringBoot性能优化之HikariCP连接池
以前一直使用阿里Druid数据库连接池,这段时间听说有个号称速度最快.代码最简的后起之秀——HikariCP,于是动手实践一下 1.依赖如下: <?xml version="1.0&q ...
- 18、DHCP
Dynamic Host Configuration Protocol DHCP的前身:Bootstrap DHCP的封装 DHCP基本知识点 1 .DHCP协议在RFC2131中定义,使用udp协议 ...
- nginx+lua在我司的实践
导读:nginx是一个高性能的反向代理服务器,lua是一个小巧的脚本语言,这两个的巧妙结合会擦出怎样的火花呢. 关键词:nginx,lua,nginx+lua 前言 nginx,lua,nginx+l ...
- 在4K屏下以超过VMWare默认的最高分辨率运行Linux系统
前言 4K 屏,有其优点也有其弊端.优点就是分辨率高,字体和图标看起来如丝一般顺滑:缺点就是字体和图标小,费眼睛.解决这个缺点的方法也很简单粗暴,就是将系统的显示比例放大.在高分屏不很普及的时候,无论 ...
- hadoop 日常使用记录
1.Hadoop分布式文件系统(HDFS) HDFS基于GFS(Google File System),能够存储海量的数据,并且使用分布式网络客户端透明访问. HDFS中将文件拆分成特定大小的块结构( ...
- TestStand 基础知识[6]--Build-in Step Types (1)
Step Types 有TestStand自带的,也有自定义的.本文先介绍自带的Step Types. 首先什么是Step Types ? 翻译过来就是步骤的类型,类似数据类型--数据有整型,字符串, ...
- XXE漏洞复现步骤
XXE漏洞复现步骤 0X00XXE注入定义 XXE注入,即XML External Entity,XML外部实体注入.通过 XML 实体,”SYSTEM”关键词导致 XML 解析器可以从本地文件或者远 ...
- Yandex Big Data Essentials Week1 Unix Command Line Interface Processes managing
free displays the total amount of free and used memory free [options] top provides a dynamic real-ti ...
- vue-cli 脚手架
vue脚手架 vue-cli 基于webpack.帮助我们完成了对项目的基本架构,冗余代码比较多 ,资源的浪费 1.全局安装vue的脚手架 cnpm install @vue/cli -g 2.查看版 ...