首页 > 编程语言 > 详细

RuntimeError: Python is not installed as a framework.

时间:2018-07-09 14:46:55      阅读:225      评论:0      收藏:0      [点我收藏+]

RuntimeError: Python is not installed as a framework.

文章转载:https://www.cnblogs.com/harelion/p/5637767.html

在Conda虚拟环境中运行matplotlib遇到异常提示:

技术分享图片

似乎是因为虚拟环境与默认环境的安装配置不同造成的。

搜索错误信息之后,在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

RuntimeError: Python is not installed as a framework.

原文:https://www.cnblogs.com/likeli/p/9283580.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!