【发布时间】:2014-01-31 02:37:51
【问题描述】:
要在 cygwin 上加载 matplotlib,我有:
使用 cygwin 64 位设置加载的先决条件:pkg-config、freetype2、libfreetype-devel、libpng-devel、gtk2.0、libgtk2.0-devel
下载了 matplotlib tar 文件 (http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz) 并更改了源代码以绕过此处建议的“_tri”错误: matplotlib error while installing pyspeckit
- 然后构建并安装了matplotlib:
$ python setup.py build
$ python setup.py 安装
我发现看起来像是 matplotlib 后端错误。有谁知道如何解决这个问题:
/usr/lib/python2.7/site-packages/gtk-2.0/gtk/init.py:57: GtkWarning: 无法打开显示 ... cursors.MOVE : gdk.Cursor(gdk.FLEUR), et n RuntimeError: 无法创建 GdkCursor 对象
编辑:我终于明白了,matplotlib 终于在 cygwin 上工作了。为此,我做了:
从 cygwin 安装程序,加载 X-Server 工具: xorg-server xinit
从 cygwin 设置中,我还加载了这些,以便使用 telnet 或 ssh 连接来运行远程 X 客户端: inetutils openssh
-
我设置了我的显示:
DISPLAY=":0.0"
导出显示 -
在 cygwin shell 中,我做到了:
$ startxwin
然后我在 X 窗口中运行了使用 matplotlib 的 python 脚本
【问题讨论】:
标签: python python-2.7 matplotlib cygwin