出现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 ...
随机推荐
- AttributeError: module 'cv2' has no attribute 'SIFT'解决总结
AttributeError: module 'cv2' has no attribute 'SIFT' 遇到该问题时,网友多是建议补个包,即pip install opencv-contrib-py ...
- ios---cocoapods 安装与使用 (AFNetworking为例)
cocoapods 安装与使用 一.CocoaPods是什么? CocoaPods是一个用Ruby写的.负责管理iOS项目中第三方开源库的工具,CocoaPods能让我们集中的.统一管理第三方开源库, ...
- Linux 常用工具openssh之ssh-copy-id
前言 ssh-copy-id命令可以把本地主机的公钥复制到远程主机的authorized_keys文件上,ssh-copy-id命令也会给远程主机的用户主目录(home)和~/.ssh, 和~/.ss ...
- Spring博客专栏
1. IOC和DI的理解 2. IOC的实现原理-反射与工厂模式 3. Spring进阶之路 4. SpringBoot配置类的使用 5. @ModelAttribute详解 6. @RequestP ...
- Linux(Centos)安装Java JDK及卸载
步骤一.下载安装包 a. 因为Java JDK区分32位和64位,所以安装之前需先判断一下我们操作系统为多少位·,命令如下: uname -a 解释:如果有x86_64就是64位的,没有就是32位 ...
- TS 原理详细解读(5)语法2-语法解析
在上一节介绍了语法树的结构,本节则介绍如何解析标记组成语法树. 对应的源码位于 src/compiler/parser.ts. 入口函数 要解析一份源码,输入当然是源码内容(字符串),同时还提供路径( ...
- 06讲案例篇:系统的CPU使用率很高,但为啥却找不到高CPU的应用
小结 碰到常规问题无法解释的 CPU 使用率情况时,首先要想到有可能是短时应用导致的问题,比如有可能是下面这两种情况. 第一,应用里直接调用了其他二进制程序,这些程序通常运行时间比较短,通过 top ...
- qt客户端程序使用svg图片资源的几种方法
直接使用svg格式文件资源的情况 1. 直接在UI控件属性面板中选择部分支持icon图标的控件的icon来源,这样图标可以显示 2.给toolbutton添加样式 qproperty-icon: ur ...
- 《Python编程:从入门到实践》分享下载
书籍信息 书名:<Python编程:从入门到实践> 原作名:Python Crash Course 作者: [美] 埃里克·马瑟斯 豆瓣评分:9.1分(2534人评价) 内容简介 本书是一 ...
- make: *** No targets specified and no makefile found. Stop.错误
# make make: *** No targets specified and no makefile found. Stop. # yum install gcc gcc-c++ gcc-g77 ...