Describe the bug
Got an IOError: [Errno 2]
when I tried to build the pandas docs in Ubuntu 18.04 LTS (Bionic Beaver) running in Windows 10. I initially posted this at sphinx-doc
issues: #6049 and #6049-reply and it was suggested there that I post it here (see additional reply in #6049).
To Reproduce Steps to reproduce the behavior:
$ git clone htps://github.com/pandas-dev/pandas
$ cd pandas
$ python setup.py build_ext --inplace --force
$ cd doc
$ python make.py clean
$ python make.py html
Expected behavior Docs get built.
Your project [None]
Screenshots [None]
Environment info - OS: Ubuntu 18.04 LTS (Bionic Beaver) running in Windows 10 - Python version: 2.7.15rc1 (CPython) - Sphinx version: 1.8.4 - Docutils version: 0.14 - Jinja2 version: 2.10
Additional context
[NOTE: Both the terminal output and .log file given below have been edited to allow anonymity.]
The terminal output after python make.py html
:
$ python make.py html
Running Sphinx v1.8.4
making output directory...
[autosummary] generating autosummary for: development/contributing.rst, development/contributing_docstring.rst, development/developer.rst, development/extending.rst, development/index.rst, development/internals.rst, ecosystem.rst, getting_started/10min.rst, getting_started/basics.rst, getting_started/comparison/comparison_with_r.rst, ..., whatsnew/v0.6.0.rst, whatsnew/v0.6.1.rst, whatsnew/v0.7.0.rst, whatsnew/v0.7.1.rst, whatsnew/v0.7.2.rst, whatsnew/v0.7.3.rst, whatsnew/v0.8.0.rst, whatsnew/v0.8.1.rst, whatsnew/v0.9.0.rst, whatsnew/v0.9.1.rst
WARNING: [autosummary] failed to import u'pandas.Timestamp.fold': no module named pandas.Timestamp.fold
[autosummary] generating autosummary for: /path/to/pandas/doc/source/reference/api/pandas.
...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 106 source files that are out of date
updating environment: 2781 added, 0 changed, 0 removed
/path/to/pandas/pandas/core/generic.py:docstring of pandas.DataFrame.asof:28: WARNING: Unexpected indentation.
/path/to/pandas/pandas/core/generic.py:docstring of pandas.DataFrame.asof:29: WARNING: Block quote ends without a blank line; unexpected unindent.
/path/to/pandas/pandas/core/generic.py:docstring of pandas.DataFrame.ewm:19: WARNING: Unexpected indentation.
/path/to/pandas/pandas/core/generic.py:docstring of pandas.DataFrame.ewm:17: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/path/to/pandas/pandas/core/accessor.py:docstring of pandas.DatetimeIndex.ceil:29: WARNING: Block quote ends without a blank line; unexpected unindent.
/path/to/pandas/pandas/core/accessor.py:docstring of pandas.DatetimeIndex.floor:29: WARNING: Block quote ends without a blank line; unexpected unindent.
/path/to/pandas/pandas/core/accessor.py:docstring of pandas.DatetimeIndex.round:29: WARNING: Block quote ends without a blank line; unexpected unindent.
/path/to/pandas/pandas/core/accessor.py:docstring of pandas.DatetimeIndex.tz_localize:36: WARNING: Block quote ends without a blank line; unexpected unindent.
/path/to/pandas/pandas/core/dtypes/dtypes.py:docstring of pandas.DatetimeTZDtype:36: WARNING: toctree references unknown document u'reference/api/pandas.DatetimeTZDtype.type'
/path/to/pandas/pandas/core/arrays/integer.py:docstring of pandas.Int16Dtype:34: WARNING: toctree references unknown document u'reference/api/pandas.Int16Dtype.type'
Exception occurred:
File "/usr/lib/python2.7/inspect.py", line 563, in findsource
raise IOError('could not find class definition')
IOError: could not find class definition
The full traceback has been saved in /tmp/sphinx-err-lTiOie.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Traceback (most recent call last):
File "make.py", line 339, in <module>
sys.exit(main())
File "make.py", line 335, in main
return getattr(builder, args.command)()
File "make.py", line 226, in html
self._add_redirects()
File "make.py", line 209, in _add_redirects
with open(path, 'w') as moved_page_fd:
IOError: [Errno 2] No such file or directory: /path/to/pandas/doc/build/html/generated/pandas.api.extensions.ExtensionArray.argsort.html'
The .log file is: sphinx-err-lTiOie-EDITED.log
Thank you very much for whatever help you can extend!
Comment From: nmusolino
I get a similar error, with the same stacktrace, on Mac OS X v10.13.6:
build succeeded, 3682 warnings.
The HTML pages are in build/html.
Traceback (most recent call last):
File "make.py", line 339, in <module>
sys.exit(main())
File "make.py", line 335, in main
return getattr(builder, args.command)()
File "make.py", line 226, in html
self._add_redirects()
File "make.py", line 207, in _add_redirects
'{}').format(path))
RuntimeError: Redirection would overwrite an existing file: /path/to/pandas/pandas/doc/build/html/generated/pandas.api.extensions.ExtensionArray.argsort.html
Comment From: TomAugspurger
cc @datapythonista. Maybe we just remove that check?
Comment From: datapythonista
I see two different cases here.
The original problem seems to be in the introspection. Not sure if the Ubuntu in windows 10 has something that makes python introspection for certain cases fail.
The comment from @nmusolino is unrelated. Looks like there is a file from an older version that makes that validation fail. Having the clean automatically when running make.py html
was taking care of that, but now that we removed it, we should probably add to the error message that a make.py clean
is required.
I personally wouldn't remove that check, we can end up removing pages from the docs unintentionally if we do.
Comment From: jbrockmendel
Is this still relevant?
Comment From: mroeschke
Not sure if this is still relevant for newer versions of Python and Sphinx so closing. But we can reopen if this issue shows up again