Anaconda运行时错误:未将Python安装为框架吗? [英] Anaconda Runtime Error: Python is not installed as a framework?

查看:110
本文介绍了Anaconda运行时错误:未将Python安装为框架吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用pkg安装程序安装了Anaconda:

I've installed Anaconda with the pkg installer:

Python 2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:04:42) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

但是当我尝试使用matplotlib中的任何内容时,即:

but when I attempt to use anything from matplotlib, i.e.:

 from matplotlib import pyplot as plt

我知道

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.

我真的不确定这意味着什么,或者如何解决它.

I'm really not sure what this means, or how to go about fixing it.

推荐答案

如果遇到此错误,请不要忘记检查bash_profile.

If you experience this error, don't forget to check your bash_profile.

您可以在终端上通过以下方式进行操作:

You can do this in terminal by:

cd

然后

nano .bash_profile

检查内容. Macports和Homebrew为自己在这里所做的事情添加了自己的标题.您可以删除它们对$ PATH所做的声明.离开那只Anaconda制造的.如果您愿意,我可以:

check the contents. Macports and Homebrew add their own headings for things they've done here. You can remove the declarations they make to $PATH. Just leave the one Anaconda has made. I had a If you would like, you can:

cp .bash_profile ./bash_profile_backup_yyyy_mm_dd 

,并备份文件,文件名索引到更改日期.也就是说,只要您实际输入日期而不是我建议的格式字符.

and have a backup of the file, with filename indexing to the date you changed it. That is, provided you actually put in the date in instead of just the formatting characters I'm suggesting.

source ~/.bash_profile

将刷新系统对bash_profile的引用,您应该很好地导入和使用matplotlib

will refresh your system's reference to the bash_profile and you should be good to go in importing and using matplotlib

这篇关于Anaconda运行时错误:未将Python安装为框架吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆