【问题标题】:Loading matplotlib on cygwin在 cygwin 上加载 matplotlib
【发布时间】:2014-01-31 02:37:51
【问题描述】:

要在 cygwin 上加载 matplotlib,我有:

  1. 使用 cygwin 64 位设置加载的先决条件:pkg-config、freetype2、libfreetype-devel、libpng-devel、gtk2.0、libgtk2.0-devel

  2. 下载了 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

  3. 然后构建并安装了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 上工作了。为此,我做了:

  1. 从 cygwin 安装程序,加载 X-Server 工具: xorg-server xinit

  2. 从 cygwin 设置中,我还加载了这些,以便使用 telnet 或 ssh 连接来运行远程 X 客户端: inetutils openssh

  3. 我设置了我的显示:

    DISPLAY=":0.0"
    导出显示

  4. 在 cygwin shell 中,我做到了:

    $ startxwin

  5. 然后我在 X 窗口中运行了使用 matplotlib 的 python 脚本

【问题讨论】:

    标签: python python-2.7 matplotlib cygwin


    【解决方案1】:

    我遇到了一个问题,“python setup.py build”找不到来自 freetype2 包的 ft2build.h。我安装了freetype2开发包,我可以在/usr/include/freetype2/ft2build.h中找到它,但是错误仍然存​​在。 在函数 check_include_file(include_dirs, filename, package) 中深入研究 setupext.py 后,我注意到 package="freetype2" 没有连接到搜索路径。因此,当它应该是“/usr/include/freetype2/ft2build.h”时,它找不到“/usr/include/ft2build.h” 修复这条线 #134

    if not has_include_file(include_dirs, "%s/%s"%(package,filename)):

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-29
      • 2018-04-17
      • 2020-10-18
      • 1970-01-01
      • 2013-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多