Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python matplotlib赢得';我不能在ubuntu 10.10上工作_Python_Ubuntu_Matplotlib - Fatal编程技术网

Python matplotlib赢得';我不能在ubuntu 10.10上工作

Python matplotlib赢得';我不能在ubuntu 10.10上工作,python,ubuntu,matplotlib,Python,Ubuntu,Matplotlib,我在让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)

我在让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包下的.matplotlib和matplotlib目录,但仍然无法完成

更奇怪的是,在我重新安装了0.99版本之后,它运行得非常好


有什么想法吗?

Ben Gamari为Ubuntu开发了matplotlib 1.0

尝试使用
pip安装它

sudo apt-get install python-pip
sudo pip install matplotlib

我刚刚测试了这个,它应该安装matplotlib 1.0.1。

我在Ubuntu 12.04上遇到了同样的问题。我解决了安装python-gtk2-dev和重新安装matplotlib的问题:

sudo apt-get install python-gtk2-dev
sudo pip install --upgrade matplotlib
有关依赖项的消息更改为:

Gtk+: gtk+: 2.24.10, glib: 2.32.3, pygtk: 2.24.0, pygobject: 2.28.6 Gtk+:Gtk+:2.24.10,glib:2.32.3,pygtk:2.24.0, pygobject:2.28.6
您可能需要安装
tk-dev
pygtk2.0-dev
(或类似)和
gtk-dev
软件包(命名可能会有所不同),然后重新构建…此外,请使用synaptic软件包管理器中提供的软件包。它对我来说很好。Ubuntu中的版本仍然是0.99。Synaptic找不到比apt get更高级的软件包。“”此处不允许。抱歉,您没有访问此页面的权限,或者此页面中的信息未与您共享。”“”