我有問題讓matplotlib在Ubuntu 10.10中工作。matplotlib將無法在Ubuntu 10.10上工作
首先我使用apt-get安裝matplotlib,後來發現版本是0.99,官方網站上的一些示例不起作用。然後我下載1.01版本並安裝它而不卸載0.99版本。爲了使情況更加具體,這裏是配置:
BUILDING MATPLOTLIB
matplotlib: 1.0.1
python: 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC
4.4.5]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.6.0b1
freetype2: 12.2.6
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.44
Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
wxPython: no
* wxPython not found
pkg-config: looking for pygtk-2.0 gtk+-2.0
* Package pygtk-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'pygtk-2.0' found
* Package gtk+-2.0 was not found in the pkg-config
* search path. Perhaps you should add the directory
* containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
* environment variable No package 'gtk+-2.0' found
* You may need to install 'dev' package(s) to
* provide header files.
Gtk+: no
* Could not find Gtk+ headers in any of
* '/usr/local/include', '/usr/include', '.'
Mac OS X native: no
Qt: no
Qt4: no
Cairo: 1.8.8
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.4.1
pytz: 2010b
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 8.71
latex: no
pdftops: 0.14.3
[Edit setup.cfg to suppress the above messages]
,現在我可以導入matplotlib但一旦我運行示例代碼,它只是終止,我沒有得到任何結果。我嘗試了幾次「清理安裝」,這意味着我刪除了所有文件,包括dist-package下的.matplotlib和matplotlib目錄,但我仍然無法完成任務。
是什麼讓更偉大的是,我重新安裝0.99版本後,它工作得很好。
任何想法?
您可能需要安裝'TK-dev'和'pygtk2.0-dev'(或類似的)和'gtk-dev'軟件包(命名可能會有所不同),然後重新編譯... – ChristopheD 2011-04-05 18:41:53