matplotlib sphinxext crashes in sphinx-build

Hi

I was going through the sampledoc tutorial in http://matplotlib.sourceforge.net/sampledoc/.

When
I came to "Sphinx extensions for embedded plots … ", sphinx-build
crashes when “matplotlib.sphinx.mathmpl” … were added to the
extensions section of conf.py.

I noticed a similar problem was reported on this mailing list March 23, 2010.

I
am running OPENSUSE 11.1 on a x86-64 computer, and my python is version
2.6. I reinstalled the latest matplotlib, “python-matplotlib
-1.0.0-5.1.x86_64.rpm” from the opensuse repository: http://download.opensuse.org/repositories/science/openSUSE_11.1/x86_64. I also installed the latest sphinx with “easy-install -U Sphinx”.

When I run ‘make html’, here is what happened:
sphinx/sampledoc> make html
sphinx-build -b html -d _build/doctrees . _build/html
Making output directory…
Running Sphinx v1.0.4
make: *** [html] Segmentation fault (core dumped)

I attached my conf.py and I uploaded the coredump (core.bz2) at:
http://sites.google.com/site/mislwagroup/coredumps-1

Thank you for your help!
Elizabeth

conf.py (6.48 KB)

Hi

I was going through the sampledoc tutorial in http://matplotlib.sourceforge.net/sampledoc/.

When I came to "Sphinx extensions for embedded plots ... ", sphinx-build crashes when "matplotlib.sphinx.mathmpl" ... were added to the extensions section of conf.py.

I noticed a similar problem was reported on this mailing list March 23, 2010.

I am running OPENSUSE 11.1 on a x86-64 computer, and my python is version 2.6. I reinstalled the latest matplotlib, "python-matplotlib -1.0.0-5.1.x86_64.rpm" from the opensuse repository: http://download.opensuse.org/repositories/science/openSUSE_11.1/x86_64. I also installed the latest sphinx with "easy-install -U Sphinx".

When I run 'make html', here is what happened:
sphinx/sampledoc> make html
sphinx-build -b html -d _build/doctrees . _build/html
Making output directory...
Running Sphinx v1.0.4
make: *** [html] Segmentation fault (core dumped)

I attached my conf.py and I uploaded the coredump (core.bz2) at:
http://sites.google.com/site/mislwagroup/coredumps-1

Are you able to generate matplotlib plots directly -- in particular using the Agg backend?

Unfortunately, this coredump file isn't useful unless we have the exact same binaries as you.

Can you instead run this inside of gdb and get a traceback?

To get this, you will do something like (from the doc directory):

> gdb python
(gdb) run /usr/bin/sphinx-build -b html -d _build/doctrees . _build/html
... it runs for a while and then crashes ...
(gdb) bt

Mike

···

On 11/04/2010 01:46 AM, Elizabeth Yip Dembart wrote:

Thank you for the prompt response.
I cannot run matplotlib directly. It crashes as I tried to import matplotlib.pyplot:

sphinx/sampledoc> python
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib.pyplot as plt
Segmentation fault (core dumped)

What do you mean by the Agg backend?

I did run sphinx-build inside gdb as you suggested.
The attached file is the captured output.

Thanks!
Elizabeth

debug_matplotlib_sphinx.out (6.27 KB)

···

On Thu, Nov 4, 2010 at 5:53 AM, Michael Droettboom <mdroe@…86…> wrote:

On 11/04/2010 01:46 AM, Elizabeth Yip Dembart wrote:

Hi

I was going through the sampledoc tutorial in

http://matplotlib.sourceforge.net/sampledoc/.

When I came to "Sphinx extensions for embedded plots … ",

sphinx-build crashes when “matplotlib.sphinx.mathmpl” … were added

to the extensions section of conf.py.

I noticed a similar problem was reported on this mailing list March

23, 2010.

I am running OPENSUSE 11.1 on a x86-64 computer, and my python is

version 2.6. I reinstalled the latest matplotlib,

“python-matplotlib -1.0.0-5.1.x86_64.rpm” from the opensuse

repository:

http://download.opensuse.org/repositories/science/openSUSE_11.1/x86_64.

I also installed the latest sphinx with “easy-install -U Sphinx”.

When I run ‘make html’, here is what happened:

sphinx/sampledoc> make html

sphinx-build -b html -d _build/doctrees . _build/html

Making output directory…

Running Sphinx v1.0.4

make: *** [html] Segmentation fault (core dumped)

I attached my conf.py and I uploaded the coredump (core.bz2) at:

http://sites.google.com/site/mislwagroup/coredumps-1

Are you able to generate matplotlib plots directly – in particular

using the Agg backend?

Unfortunately, this coredump file isn’t useful unless we have the exact

same binaries as you.

Can you instead run this inside of gdb and get a traceback?

To get this, you will do something like (from the doc directory):

gdb python

(gdb) run /usr/bin/sphinx-build -b html -d _build/doctrees . _build/html

… it runs for a while and then crashes …

(gdb) bt

Mike


The Next 800 Companies to Lead America’s Growth: New Video Whitepaper

David G. Thomson, author of the best-selling book "Blueprint to a

Billion" shares his insights and actions to help propel your

business during the next growth cycle. Listen Now!

http://p.sf.net/sfu/SAP-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

This is our core rendering engine -- see
http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend

The problem you are experiencing has nothing to do with sphinx or the
sphinx extensions, but is in your matplotlib installation. It may be
a SUSE bug, or you may be getting conflicting installs from the stuff
you are getting from SUSE and the stuff you are easy installing.
First thing to do is start nailing down what you are getting and where
you are getting it from. Paste these commands into your python shell
and report the output

import numpy as np
print np.__file__
print np.__version__

import matplotlib as mpl
print mpl.__file__
print mpl.__version__

A likely culprit is that you have an mpl compiled against one version
of numpy and you are dynamically linking against another that is not
ABI compliant.

JDH

···

On Thu, Nov 4, 2010 at 11:43 AM, Elizabeth Yip Dembart <elyip.dembart@...287...> wrote:

Thank you for the prompt response.
I cannot run matplotlib directly. It crashes as I tried to import
matplotlib.pyplot:

sphinx/sampledoc> python
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib.pyplot as plt

Segmentation fault (core dumped)

What do you mean by the Agg backend?

Thanks !!

Here is the output from the python section you suggested:

/sampledoc> python
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import numpy as np
print np.file
/usr/lib64/python2.6/site-packages/numpy/init.pyc

print np.version
1.2.1

import matplotlib as mpl
print mpl.file
/usr/lib64/python2.6/site-packages/matplotlib/init.pyc

print mpl.version
1.0.0

Elizabeth

···

On Thu, Nov 4, 2010 at 9:53 AM, John Hunter <jdh2358@…287…> wrote:

On Thu, Nov 4, 2010 at 11:43 AM, Elizabeth Yip Dembart > > <elyip.dembart@…287…> wrote:

Thank you for the prompt response.

I cannot run matplotlib directly. It crashes as I tried to import

matplotlib.pyplot:

sphinx/sampledoc> python

Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)

[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib.pyplot as plt

Segmentation fault (core dumped)

What do you mean by the Agg backend?

This is our core rendering engine – see

http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend

The problem you are experiencing has nothing to do with sphinx or the

sphinx extensions, but is in your matplotlib installation. It may be

a SUSE bug, or you may be getting conflicting installs from the stuff

you are getting from SUSE and the stuff you are easy installing.

First thing to do is start nailing down what you are getting and where

you are getting it from. Paste these commands into your python shell

and report the output

import numpy as np

print np.file

print np.version

import matplotlib as mpl

print mpl.file

print mpl.version

A likely culprit is that you have an mpl compiled against one version

of numpy and you are dynamically linking against another that is not

ABI compliant.

JDH

Well, they are both coming from the same place so it looks like the
SUSE build of each. But the numpy version is quite old. Looks like
it may be an OPENSUSE bug

http://forums.opensuse.org/english/development/programming-scripting/416182-python-matplolib.html

You could consider building matplotlib from source.

  http://matplotlib.sourceforge.net/users/installing.html
  http://matplotlib.sourceforge.net/faq/installing_faq.html#source-install
  http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn

or upgrading your linux distribution (ubuntu 10.10 is nice)

JDH

···

On Thu, Nov 4, 2010 at 12:06 PM, Elizabeth Yip Dembart <elyip.dembart@...287...> wrote:

Thanks !!

Here is the output from the python section you suggested:

/sampledoc> python
Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy as np
print np.__file__

/usr/lib64/python2.6/site-packages/numpy/__init__.pyc

print np.__version__

1.2.1

import matplotlib as mpl
print mpl.__file__

/usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc

print mpl.__version__

1.0.0

Thanks !

matplotlib (import pylab) works in the sage notebook ( http://www.sagemath.org/ )on my machine. The sage installation compiles everything from source!!

We are actually thinking of abandoning SUSE (after 5 years) and switch to ubuntu !

Thanks again!
Elizabeth

···

On Thu, Nov 4, 2010 at 10:13 AM, John Hunter <jdh2358@…287…> wrote:

On Thu, Nov 4, 2010 at 12:06 PM, Elizabeth Yip Dembart > <elyip.dembart@…287…> wrote:

Thanks !!

Here is the output from the python section you suggested:

/sampledoc> python

Python 2.6 (r26:66714, Dec 3 2008, 10:55:18)

[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import numpy as np

print np.file

/usr/lib64/python2.6/site-packages/numpy/init.pyc

print np.version

1.2.1

import matplotlib as mpl

print mpl.file

/usr/lib64/python2.6/site-packages/matplotlib/init.pyc

print mpl.version

1.0.0

Well, they are both coming from the same place so it looks like the

SUSE build of each. But the numpy version is quite old. Looks like

it may be an OPENSUSE bug

http://forums.opensuse.org/english/development/programming-scripting/416182-python-matplolib.html

You could consider building matplotlib from source.

http://matplotlib.sourceforge.net/users/installing.html

http://matplotlib.sourceforge.net/faq/installing_faq.html#source-install

http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn

or upgrading your linux distribution (ubuntu 10.10 is nice)

JDH