我收到此错误:
/sw/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py:235:UserWarning:Python未作为框架安装.如果未将Python安装为框架,则MacOSX后端可能无法正常工作.有关在Mac OS X上安装Python作为框架的更多信息,请参阅Python文档
我使用fink安装了python27,并且使用默认的matplotlib是使用macosx框架.
在Mac OS X上,Python构建和非框架构建(即标准UNIX构建)之间有什么区别?另外,每个的优点和缺点是什么?
以下是我在发布此问题之前找到的信息:
在Mac OS X 10.6 Snow Leopard之前,我没有考虑过这个,因为我只是下载并安装Python 2.6.2 Mac安装程序磁盘映像,这是一个框架构建,并使用virtualenv,pip继续我的业务但是,随着Snow Leopard到64位,gcc等的变化,我注意到一些问题让我想要从源代码构建/编译Python 2.6.2+,这让我想到了将Python构建为MacOSX | Darwin框架的差异和优缺点的问题.
我用pkg安装程序安装了Anaconda:
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
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用matplotlib中的任何东西时,即:
from matplotlib import pyplot as plt
Run Code Online (Sandbox Code Playgroud)
我明白了
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 …Run Code Online (Sandbox Code Playgroud)