Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failes under ubuntu 13.04 #1949

Merged
merged 2 commits into from Apr 26, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Apr 26, 2013

Just tried to build current master under ubuntu raring, but I get an error (dependencies are installed with sudo apt-get build-dep python-matplotlib before) from the gtk check:


$ python setup.py build
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.3.x]
                python: yes [2.7.4 (default, Apr 19 2013, 18:28:01)  [GCC
                        4.7.3]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.7.1]
              dateutil: yes [using dateutil version 1.5]
               tornado: yes [using tornado version 2.4.1]
             pyparsing: yes [using pyparsing version 1.5.7]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found Using local copy.]
              freetype: yes [version 16.0.10]
                   png: yes [version 1.2.49]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: yes [using nose version 1.1.2]

OPTIONAL BACKEND EXTENSIONS
                macosx: no  [Mac OS-X only]
                qt4agg: yes [Qt: 4.8.4, PyQt4: 4.10]
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:48: RuntimeWarning: You have imported the Gtk 2.0 module.
Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this
is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. 
PyGTK is the recomended python module to use with Gtk 2.0
  warnings.warn(warn_msg, RuntimeWarning)
Traceback (most recent call last):
  File "setup.py", line 131, in <module>
    result = package.check()
  File "/.../matplotlib/setupext.py", line 1451, in check
    success, msg = p.map(backend_gtk3agg_internal_check, [0])[0]
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 250, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 554, in get
    raise self._value
AttributeError: 'gi.repository.Gtk' object has no attribute 'get_major_version'

It doesn't help to set gtk = False and gtkagg = False in setup.cfg

@mdboom
Copy link
Member

mdboom commented Apr 26, 2013

In setup.cfg, are you putting gtk = False under the [gui_support] section, i.e.:

[gui_support]
gtk=False

For me, that works -- i.e. I can't reproduce the part of this bug where the gtk check isn't being turned off altogether.

As for the rest, this error message:

/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:48: RuntimeWarning: You have imported the Gtk 2.0 module.
Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this
is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. 
PyGTK is the recomended python module to use with Gtk 2.0

most likely indicates that you do not have the gtk3 development files installed. See this StackOverflow question:

http://stackoverflow.com/questions/11828995/why-my-gi-repository-gtk-keeps-using-gtk-2-modules

At matplotlib's end, we should probably specify that gobject introspection will only work with Gtk 3.0 and fail more gracefully if it can't be found. We still use the old pygtk interface for Gtk 2.0 (which still should work).

… gi so we can provide a better error message
@bmu
Copy link
Author

bmu commented Apr 26, 2013

I copied setup.cfg.template to setup.cfg and then I changed gtk and gtkagg to False under the [gui_support] section. However the error occurs.

Installing libgtk3-dev solved the problem, I can build matplotlib now.

@mdboom
Copy link
Member

mdboom commented Apr 26, 2013

Good news. I see why the disabling didn't work for you now (and I mistyped in my earlier message). It's the gtk3 and gtk3agg extensions you would want to disable to avoid this (not gtk and gtkagg), but those are missing from the template file. I'll be sure to add those.

Thanks.

mdboom added a commit that referenced this pull request Apr 26, 2013
@mdboom mdboom merged commit d94036c into matplotlib:master Apr 26, 2013
@megies
Copy link
Contributor

megies commented Aug 22, 2013

I have come across the same error (building 1.3.0 from source on Debian wheezy 64bit) and actually for me the respective backend checks are not skipped even if I copy setup.cfg.template to setup.cfg and set gtk3cairo and gtk3agg to False. I put a breakpoint in OptionalBackendPackage.get_config() and found that it actually doesn't get called at all for some of the backends (namely qt4agg, gtk3cairo, gtk3agg, wxagg, cairo and windowing). To me it looks like the overridden check() methods in the subclasses for these backends never look at the config. I excepted the error locally so for me this is not a problem, I just wanted to mention it. I'll open a pull request to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants