- python/
- Python 在cygwin上加载matplotlib
Python 在cygwin上加载matplotlib
Python 在cygwin上加载matplotlib,python,python-2.7,matplotlib,cygwin,Python,Python 2.7,Matplotlib,Cygwin,要在cygwin上加载matplotlib,我必须:
使用cygwin 64位设置加载的先决条件:pkg config、freetype2、libfreetype-devel、libpng-devel、gtk2.0、libgtk2.0-devel
下载了matplotlib tar文件()并更改了源代码,以绕过此处建议的“\u tri”错误:
然后构建并安装matplotlib:
$python setup.py build
$python setup.py安装
我发现matplotlib后
要在cygwin上加载matplotlib,我必须:
使用cygwin 64位设置加载的先决条件:pkg config、freetype2、libfreetype-devel、libpng-devel、gtk2.0、libgtk2.0-devel
下载了matplotlib tar文件()并更改了源代码,以绕过此处建议的“\u tri”错误:
然后构建并安装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运行时错误:无法创建GdkCursor对象
编辑:我终于得到了它,matplotlib终于在cygwin上工作了。为此,我做了:
从cygwin安装程序中,加载X-Server工具:
xorg服务器xinit
从cygwin安装程序中,我还加载了这些,以便使用telnet或ssh连接来运行远程X客户端:
inetutils-openssh
我设置我的显示器:
DISPLAY=“:0.0”
输出显示
在cygwin shell上,我做到了:
$startxwin
然后,我在X窗口中运行了使用matplotlib的python脚本
我遇到了一个问题,“python setup.py build”找不到来自freetype2包的ft2build.h。我安装了freetype2开发包,我可以在/usr/include/freetype2/ft2build.h中找到它,但错误仍然存在。
在函数check_include_文件(include_dirs、filename、package)中深入研究setupext.py之后,我注意到package=“freetype2”没有连接到搜索路径。因此,当它应该是“/usr/include/freetype2/ft2build.h”时,它找不到“/usr/include/ft2build.h”
修好这条线#134
如果没有包含文件(包含目录,“%s/%s”%(包,文件名)):