documentation build issue with sphinx >= 1.1 in stats tutorial (Trac #1671) #2196

scipy-gitbot opened this Issue Apr 25, 2013 · 7 comments


None yet

1 participant


Original ticket on 2012-06-07 by @dlax, assigned to @rgommers.

With sphinx >= 1.1 (tested with 1.1.2 and 1.1.3), the documentation fails to build with the following error:

reading sources... [100%] tutorial/stats                                                                           
Exception occurred:
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 195, in run
    results =, input_lines, input_offset)
  File "/usr/lib/pymodules/python2.7/docutils/", line 237, in run
    context, state, transitions)
  File "/usr/lib/pymodules/python2.7/docutils/", line 458, in check_line
    return method(match, context, next_state)
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 2283, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 2295, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 2036, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 2087, in run_directive
    result =
  File "/usr/lib/pymodules/python2.7/docutils/parsers/rst/", line 382, in run
    self.state, self.state_machine)
  File "/usr/lib/pymodules/python2.7/matplotlib/sphinxext/", line 210, in plot_directive
    return run(arguments, content, options, state_machine, state, lineno)
  File "/usr/lib/pymodules/python2.7/matplotlib/sphinxext/", line 627, in run
    fd = open(source_file_name, 'r')
IOError: [Errno 2] No such file or directory: u'/home/denis/src/python/scipy/doc/source/examples/'

This was already discussed in [ PRgh-679].

Here is a patch for this (that I have to apply each time I build the doc...).


@rgommers wrote on 2012-06-07

I'm okay with bumping up the required Sphinx version if that fixes it for everyone (and it's not buggy).

Need to check the number of warnings from a doc build and the total number of pages in the refguide; no better way to catch Sphinx bugs that I know of.


@rgommers wrote on 2012-08-19

I upgraded to Sphinx 1.1.3, but everything still works for me - both with make html in the doc dir and with paver pdf in the base dir. So this patch will likely break things for me.


@rgommers wrote on 2012-11-13

Finally figure this out before the next release. See


Milestone changed to 0.12.0 by @rgommers on 2012-11-13


@pv wrote on 2012-11-15

I suspect it's because the path handling in the plot_directive bundled with matplotlib is not compatible with the one in numpydoc. This was overlooked when the work was merged back into matplotlib.

The solution is probably to never use the plot_directive from numpydoc, and require a recent enough matplotlib.

Related: matplotlib/matplotlib#385


@pv wrote on 2012-11-18

Resolved by a45291b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment