如何在Cygwin上安装Matplotlib? [英] how to install Matplotlib on Cygwin?

查看:1383
本文介绍了如何在Cygwin上安装Matplotlib?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在最新的Cygwin上安装Matplotlib 1.0.1版本。在处理中,有一个奇怪的fork错误不能解决。我googled类似的问题,发现它可以通过手动运行gcc / g ++与matplotlib 0.98.5.2: http: //innuendopoly.org/arch/matplotlib-cygwin 。但它不工作在1.0.1版本下。有没有人遇到同样的问题?

I'm trying to install Matplotlib 1.0.1 version on latest Cygwin. In the processing, there is a weird fork error cannot be solved. I googled similar questions and found that it might be solved by manually running gcc/g++ with matplotlib 0.98.5.2 : http://innuendopoly.org/arch/matplotlib-cygwin. But it doesn't work under 1.0.1 version. Does anybody encounter the same problem?

推荐答案

这里是如何在Cygwin安装matplotlib 1.1.0的说明

Here are instructions for how to install matplotlib 1.1.0 on Cygwin

http:/ /berlinbrowndev.blogspot.com/2012/01/python-matplotlib-plotting-setup-for.html

Matplotlib是一个流行的python库,用于生成图形图形。它适用于cygwin win32,但需要一些非直观的步骤。

Matplotlib is a popular python library for generating plot graphics. It works with cygwin win32 but some non-intuitive steps are required.

CYGWIN_NT-5.1 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin

我使用cygwin安装程序2.7.3

I am using cygwin with setup 2.7.3

本文档介绍如何使用cygwin安装python和matplot。对于大多数windows用户和cygwin用户,通常你会使用外部python可执行文件。我倾向于喜欢通过cygwin(包括python)运行的所有面向脚本的应用程序。

This document describes installing python and matplot with cygwin. For most windows users and cygwin users, normally you would use the external python executable. I tend to prefer all of my script oriented applications running through cygwin including python.

Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin

在cygwin setup.exe安装程序中,安装:

In the cygwin setup.exe installer, install:


  • freetype libs,python-gtk,python-tk,libpng

  • gcc

我使用的是从2012年1月起的最新版本matplotlib-1.1.0。

I am using the latest version matplotlib-1.1.0 as of 1/2012.

下载并解压matplotlib tarball

Download and extract the matplotlib tarball

典型的python setup.py install不适用于cygwin。您需要修改配置文件并运行其他一些附加命令。

The typical 'python setup.py install' will not work with cygwin. You need to modify a configuration file and run some other additional commands.

在扩展的matplotlib目录的根目录中,将setup.cfg.template配置文件复制到setup .cfg。编辑setup.cfg。

In the root directory of the expanded matplotlib directory, copy the setup.cfg.template configuration file to setup.cfg. Edit setup.cfg.

在文件中的第70行附近是注释行,取消注释行,使您有:

Around line 70 in the file is a commented line, uncomment the line such that you have:

tkagg = False



运行安装并观看失败



尝试运行'python setup.py install'

Run install and watch it fail

Try running 'python setup.py install'

它应该会失败,

2 [main] python 2796 C:\cygwin\bin\python.exe: *** fatal error - unable to remap C:\cygwin\bin\cyggfortran-3.dll to same address as parent: 0x18660000 != 0x69780000
Stack trace:



运行rebase命令在典型CYGWIN ENV外部



退出cygwin并关闭所有cygwin实例正在使用。

Run the rebase command OUTSIDE OF THE TYPICAL CYGWIN ENV

Exit cygwin and close all cygwin instances including the one you are working with. You won't be using the typical cygwin prompt for the next command.

在Windows资源管理器中,打开cmd.exe或Windows命令

In windows explorer, open the cmd.exe or windows command

您将需要运行rebaseall。首先,关闭任何长时间运行的进程,如sshd,关闭所有Cygwin提示等。

You will need to run rebaseall. First, shut down any long running processes like sshd, close all Cygwin prompts and so on.

键入以下命令:

cd \cygwin\bin
ash
PATH=. rebaseall -v

...

输出。

尝试再次运行python setup.py install matplotlib目录

Try running 'python setup.py install' command again in the matplotlib directory

# python
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
import matplotlib.pyplot as pyplot
pyplot.pie([1,2,3])
pyplot.show()
pyplot.savefig('f.png')
pyplot.savefig('x.eps')

这篇关于如何在Cygwin上安装Matplotlib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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