出现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 ...
随机推荐
- wirkshark过滤规则
https://blog.csdn.net/wojiaopanpan/article/details/69944970
- Centos 7 最小化部署jenkins
前言 jenkins是devops与CI/CD的重要工具之一,下面通过jenkins与svn的结合完成自动部署功能 环境 软件 名称 版本 操作系统 Centos 7.4 开发环境 jdk 1.8 中 ...
- 程序的健壮性Robustness
所谓的程序健壮性是指处理异常的能力,在异常中能够独立处理异常,并且把正确的答案输出. 例如: 有一个程序能够下载一个文件到指定的路径,但是这个路径是不存在的,因此程序必须要处理这个情况. 例1:下面的 ...
- 通过 SCF Component 轻松构建 REST API,再也不用熬夜加班了
本教程将分享如何通过 Serverless SCF Component .云函数 SCF 及 API 网关组件,快速构建一个 REST API 并实现 GET/PUT 操作. 当一个应用需要对第三方提 ...
- 今天你上班了吗?来聊聊一个隐蔽了 5 年的BUG!
前言 今天,我们要揭晓一个 FineUI 隐藏最深的一个BUG,这个问题从 2014-07-30 发布 FineUIPro v1.0.0 就一直存在,直到最新于 2020-01-10 发布的 v6.1 ...
- 死磕java(4)
数组 public void int4() { int[] int2 = {1,2,3,4}; System.out.print(int2[2]); } 输出:3 另一种数组的初始化 public ...
- sock.listen()
(转载) 函数原型: int listen(int sockfd, int backlog); 当服务器编程时,经常需要限制客户端的连接个数,下面为问题分析以及解决办法: 下面只讨论TCP UDP不 ...
- windows 使用ssh连接docker容器
在Windows上搭建docker服务器需要在Windows模拟一个Linux平台,然后在Linux平台上搭建的docker服务器,所以在使用ssh工具连接docker容器的时候,使用的ip地址不是d ...
- Loj 6002 最小路径覆盖(最大流)
题意: 求不相交的最小路径覆盖 思路: 连边跑二分图,匹配一条边相当于缩了一条边,答案为n-maxflow 如果是求可以相交的最小路径覆盖的话,先用Floyd跑出可达矩阵,然后所有可达的点连边跑二分图 ...
- Java并发编程(三):ReentrantLock
ReentrantLock是可以用来代替synchronized的.ReentrantLock比synchronized更加灵活,功能上面更加丰富,性能方面自synchronized优化后两者性能没有 ...