RuntimeError: Python is not installed as a framework. Mac下使用Matplotlib报错
使用为python环境导致的 使用虚拟环境以别导入matplotlib中的内容会报错 需要先导入再设置一下
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
或是添加设置到文件中
vi ~/.matplotlib/matplotlibrcbackend: TkAgg
官方给出了设置虚拟环境的文档但是由于我使用的pipenv 没能生效 virtualenv使用matplotlib
修改python环境地址
#!/bin/bash# what real Python executable to use
PYVER=2.7
PATHTOPYTHON=/usr/local/bin/
PYTHON=${PATHTOPYTHON}python${PYVER}# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print(os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..')))"`# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"
function frameworkpython {if [[ ! -z "$VIRTUAL_ENV" ]]; thenPYTHONHOME=$VIRTUAL_ENV /usr/local/bin/python "$@"else/usr/local/bin/python "$@"fi
}
RuntimeError: Python is not installed as a framework. Mac下使用Matplotlib报错相关推荐
- python导入matplotlib出错_解决导入matplotlib的RuntimeError: Python is not installed as a framework....
import matplotlib.pyplot as plt 报错: RuntimeError: Python is not installed as a framework. The Mac OS ...
- Python via virtualenv on Mac OS X: RuntimeError: Python is not installed as a framework.
I've previously written a couple of blog posts about my troubles getting matplotlib to play nicely a ...
- RuntimeError: Python is not installed as a framework 错误解决方案
RuntimeError: Python is not installed as a framework 错误解决方案 参考文章: (1)RuntimeError: Python is not ins ...
- runtime error python怎么解决_RuntimeError: Python is not installed as a framework 错误解决方案...
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题: >>> import matplotlib.pyplot as plt Traceback (most ...
- 关于python下解决pyspark报错问题
关于python下解决pyspark报错问题 问题描述: Java not found and JAVA_HOME environment variable is not set. Install J ...
- CentOS7.3+python:zipimport.ZipImportError: can't decompress data; zlib not available报错
文章目录 CentOS7.3+python:zipimport.ZipImportError: can't decompress data; zlib not available报错 一.前言 二.升 ...
- Deepin下安装scrapy报错fatal error: Python.h: 没有那个文件或目录
Deepin下安装scrapy报错(亲测有效!) 问题描述 在deepin操作系统上,使用python3.6,通过sudo pip3 install scrapy安装时候,出现以下错误: src/tw ...
- Python翻转字典,以及解决IndentationError: expected an indented block报错!
1,Windows+R启动:运行 2,输入:cmd 回车打开! 3,输入python(假设你已经安装过了python) 里面还会出现版本号! 4,输入代码: 注意:如果空格缩进不对,会报错的! 比如: ...
- python xlwt写入excel_python xlwt模块写入excel超过65536行报错问题解决方法
上篇文章中将内容写到excel中使用import xlwt包,后来发现文件写入超过65536行的时候就会报错,无法转换成功, xls后缀文件,只支持这么多行,在网上搜索一下,解决方法可以写多个shee ...
- python中升级pip报错_linux系统下pip升级报错的解决方法
Pip 安装 1.在python中提供了一个get-pip.py;下面是地址 https://bootstrap.pypa.io/get-pip.py 2.在Linux下执行curl https:// ...
最新文章
- Django model层 mysql_Django模型层(models.py)之模型创建
- Php如何发出请求,PHP中如何发送HTTP请求?
- android后台如何动态添加图片,android – 如何从JSON数组动态地向ImageView添加图像...
- solaris与linux区别,solaris与linux命令的区别
- erlang 怎么获得socket中的属性_技术干货,python中的异步网络框架socketserver
- Inotify+Rsync实现linux文件实时同步
- 大数据时代企业如何保障数据安全?这款工具值得一看
- 2台服务器虚拟存储,虚拟存储的主要用途
- sql trim()函数去掉两头空格
- oracle 触发器 select :new,帮忙看下这个oracle触发器,在select后面的where语句有有关问题,但不知道什么有关问题...
- 第 6-3 课:SpringBoot 核心 + 面试题
- machinery入门看这一篇(异步任务队列)
- 可穿戴医疗设备行业调研报告 - 市场现状分析与发展前景预测
- dump java 分析工具,java内存分析工具 jmap,jhat及dump分析
- Android车载方案公司,你该何去何从?
- oracle临时表空间占用率过高,ORACLE 临时表空间使用率过高的原因及解决方案
- WSO2流处理器相关学习(1)快速入门指南【转】
- 08Spring Boot自定定义配置
- iPad开发强制横屏
- EventBus原理与源码解析