出现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 ...
随机推荐
- ThinkPHP 5.0.7 + MySQL 构建RESTful API的小程序---02-ThinkPHP5中的orm的模型关联
ThinkPHP5.0中的操作ORM的一对一,一对多,多对多的操作: 由以下表举例: banner表的设计 id name description delete_time update_time 1 ...
- windows 安装mongodb2
安装文件:mongodb-win32-x86_64-2008plus-ssl-3.2.6-signed.msi 电脑配置:win7 64位 MongoDB的安装很简单,设置好安装路径后,一直Next直 ...
- Tomcat项目启动常见错误以及原因,持续更新.........
一 Context initialization failed 错误截图: 原因: jdk版本与项目不对应,可重新设置项目jdk和ide编译的jdk即可
- 一段关于用户登录 和乘法表的python代码
用户登录代码(低配): name = 1password =11counter = 1while counter <3 : a = int(input ('name:')) #注意这里 inpu ...
- HDU 6186 CS Course (连续位运算)
CS Course Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- CentOS使用Postfix发送邮件
1)配置hosts映射 [root@mail ~]# ifconfig ens33 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mt ...
- 基于原生的 html css js php ajax做的一个 web登录和注册系统
完整代码下载: 百度网盘地址 https://pan.baidu.com/s/1D1gqHSyjgfoOtYCZm7ofJg 提取码 :nf0b 永久有效 注意: 1 如果要正常运行此示例, 本地需要 ...
- VFP9利用_GdiPlus类处理图片分辨率及缩放
VFP利用GDI来处理图片,已经不是一件太难的事了.GdiPlus类就是专门来干这事的,有关其属性等请参考其它资料.下面将处理图片缩放及分辨率的代码示例贴出来.这些代码都是很久以前的了,由于新冠宅家无 ...
- 洛谷P1157----组合数的输出
#include<stdio.h> ] = { ,,,,,,,,,,,,,,,,,,, }; ]; int n, r; ; void dfs(int x) {//x表示当前是第几个数 in ...
- Mac解决:xcode-select: error: command line tools are already installed, use "Software Update" to install updates
1.因为node项目终端报错: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com ...