macosx下的python matplotlib框架? [英] python matplotlib framework under macosx?

查看:187
本文介绍了macosx下的python matplotlib框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:

/sw/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py:235: UserWarning:Python未安装为框架. MacOSX 如果未将Python安装为后端,则后端可能无法正常工作 框架.请参阅Python文档以获取更多信息 在Mac OS X上将Python安装为框架

/sw/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py:235: UserWarning: Python is not installed as a framework. The MacOSX backend may not work correctly if Python is not installed as a framework. Please see the Python documentation for more information on installing Python as a framework on Mac OS X

我使用fink安装了python27,并且使用默认的matplotlib使用macosx框架.

I installed python27 using fink and it's using the default matplotlib is using macosx framework.

推荐答案

有两种方法可以在Mac OS X上构建和安装Python.一种是作为传统的扁平Unix-y共享库.另一种称为framework安装,其文件布局类似于OS X上的其他框架,在该框架中,该产品的所有组件目录(includelibbin)都作为主目录下的子目录安装.框架目录. Fink项目使用Unix共享库方法安装Python.大多数其他发行商,包括OS X中Apple提供的Python,python.org安装程序和MacPorts项目,都安装Python的framework版本.框架安装的优点之一是,它可以与需要窗口管理器连接(通常是GUI相关的接口)的各种OS X API调用一起正常使用,因为Python解释器打包为框架内的应用程序包.

There are two ways Python can be built and installed on Mac OS X. One is as a traditional flat Unix-y shared library. The other is known as a framework install, a file layout similar to other frameworks on OS X where all of the component directories (include, lib, bin) for the product are installed as subdirectories under the main framework directory. The Fink project installs Pythons using the Unix shared library method. Most other distributors, including the Apple-supplied Pythons in OS X, the python.org installers, and the MacPorts project, install framework versions of Python. One of the advantages of a framework installation is that it will work properly with various OS X API calls that require a window manager connection (generally GUI-related interfaces) because the Python interpreter is packaged as an app bundle within the framework.

如果确实需要matplotlib中需要GUI功能的功能,则最简单的方法可能是切换到MacPorts,该MacPorts还打包了matplotlib(port py27-matplotlib)及其依赖项.如果是这样,请注意不要在FinkMacPorts之间混用软件包.除非您非常小心,否则最好坚持使用其中一个.相应地调整您的外壳路径;删除所有Fink软件包并安装MacPorts版本是最安全的.

If you do need the functions in matplotlib that require the GUI functions, the simplest approach may be to switch to MacPorts which also packages matplotlib (port py27-matplotlib) and its dependencies. If so, be careful not to mix packages between Fink and MacPorts. It's best to stick with one or the other unless you are really careful. Adjust your shell path accordingly; it would be safest to remove all of the Fink packages and install MacPorts versions.

这篇关于macosx下的python matplotlib框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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