runtime error python怎么解决_RuntimeError: Python is not installed as a framework 错误解决方案...
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题:
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "", line 1, in
...
in
from matplotlib.backends import _macosx
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 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 Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ
似乎是因为虚拟环境与默认环境的安装配置不同造成的。
搜索错误信息之后,在STO上找到了解决方案:
1、pip安装matplotlib之后,会在根目录下产生一个.matplotlib的目录:
➜ bin ll ~/.matplotlib
total 280
-rw-r--r-- 1 me staff 78K 10 4 2015 fontList.cache
-rw-r--r-- 1 me staff 59K 1 17 15:56 fontList.py3k.cache
drwxr-xr-x 2 me staff 68B 10 4 2015 tex.cache
2、在这个目录下创建一个名为matplotlibrc的文件,内容是:
backend: TkAgg
然后保存退出,重启Python交互界面或重新运行脚本,import正常执行。
STO答案地址:http://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python
runtime error python怎么解决_RuntimeError: Python is not installed as a framework 错误解决方案...相关推荐
- RuntimeError: Python is not installed as a framework 错误解决方案
RuntimeError: Python is not installed as a framework 错误解决方案 参考文章: (1)RuntimeError: Python is not ins ...
- Microsoft Visual C++ Runtime Library Runtime Error的一个解决方法
今天打开电脑,打开软件时出现了如下情况: 软件打不开并且会出现Runtime error错误,遂在网上寻找解决方法,都试了试但是并未解决问题. 想了想,这个问题出现的原因应该是VC++的运行库出现了问 ...
- Runtime Error(ACCESS_VIOLATION)常见解决方法
Runtime Error(ACCESS_VIOLATION)即运行时访问了非法内存导致异常. 在我看来,主要有以下三种情况会导致这种错误: 数组开的不够大,假如题目的数据范围是1e6,而我们如果只开 ...
- 【linux】解决设置CentOS7虚拟机使用静态IP的常见错误解决方案
最近在VMware虚拟机里玩Centos,装好后发现上不了网.经过一番艰辛的折腾,终于找到出解决问题的方法了.最终的效果是无论是ping内网IP还是ping外网ip,都能正常ping通.方法四步走: ...
- Micosoft Visual C++ Runtime Library Runtime Error! Program: E:\UserschenliqunAnaconda3\python.exe
pycharm跑项目出现Microsoft Visual C++ Runtime Library Runtime Error! Program: E:\Users\Anaconda3\python.e ...
- c++ 调用 python脚本, runtime error r6034
c++ 调用 python脚本, runtime error r6034 vs2015,c++调用python 脚本,PyImport_ImportModule的时候报了个run time error ...
- 运行出错 runtime error
在网上查找和总结后记录了下面的解决方法. runtime error (运行时错误)就是程序运行到一半,程序就崩溃了. 比如说: ①除以零②数组越界:int a[3]; a[10000000]=10; ...
- VJ runtime error可能的原因
自己刚开始在virtual judge上做题的时候,时不时会遇到runtime error的情况,因为不了解在线评测系统的报错方法,调试废了不少时间.在网上查找和总结后记录了下面的解决方法. runt ...
- 【Python】解决urllib返回http error 503问题
[Python]解决urllib返回http error 503问题:https://www.cnblogs.com/tiandsp/p/13783038.html
最新文章
- STM32CubeMX简介、下载及安装(NB-IoT专栏—基础篇3)
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 在CentOS上禁用IPv6
- vb链接mysql登录界面_求大神!有谁会用VB设计用户登陆界面连接到数据库
- kubeadm单集群部署k8s1.15.1flannel网络
- 华为手机记事本导出_涨知识!原来华为手机自带的录音转文字这么好用,秒变会议神器...
- linux中timer的作用,linux - linux / timer.h setup_timer()到期功能不起作用? - 堆栈内存溢出...
- @encode(type)的使用
- 网络协议:关于TCP/IP,必须知道的十个知识点
- 7. memcache 细节
- WORD文件拼版生成PDF方法
- php添加ico,PHP生成ICO图标的代码
- GET请求淘宝H5页面获取商品信息
- 今天来聊聊CAD的“外挂”
- postman全方位讲解(有空看下)
- win7 mysql 应用程序无法启动因为应用程序的并行配置不正确
- matlab中plot函数画线时 颜色和类型
- 在discuz论坛增加背景音乐代码
- 面试遇见简单算法总结
- 时针分针角度问题(不含秒针)