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

Current Sphinx version incompatible with numpydoc #406

Closed
sbenthall opened this issue Oct 19, 2019 · 4 comments
Closed

Current Sphinx version incompatible with numpydoc #406

sbenthall opened this issue Oct 19, 2019 · 4 comments
Assignees

Comments

@sbenthall
Copy link
Contributor

I'm trying to build the documentation using Sphinx.

With sphinx-build properly running with Python 3, I've tried make html in the Documentation directory as per the instructions

I get the following error:

~/projects/econ-ark/HARK/Documentation$ make html
sphinx-build -b html -d ../../HARK-docs/doctrees   . ../../HARK-docs/html
Running Sphinx v2.2.0
Inserting /home/sb/projects/econ-ark/HARK

Extension error:
Could not import extension numpydoc (exception: cannot import name 'Directive')
Makefile:63: recipe for target 'html' failed
make: *** [html] Error 2

Looking up this error, it looks like it's the result of incompatibility between the current version of Sphinx (v2.2.0) and the numpydoc extension:
readthedocs/readthedocs.org#4057

The recommended fix from that issue, which is quite old (from May, 2018) is the fix the Sphinx version in requirements.txt to an early version, sphinx==1.6.7

@sbenthall
Copy link
Contributor Author

Reverting to sphinx=1.6.7 and trying make html gets this new error:

$ make html
sphinx-build -b html -d ../../HARK-docs/doctrees   . ../../HARK-docs/html
Running Sphinx v1.6.7
Inserting /home/sb/projects/econ-ark/HARK
/home/sb/anaconda3/lib/python3.6/site-packages/sphinx/util/compat.py:40: RemovedInSphinx17Warning: sphinx.util.compat.Directive is deprecated and will be removed in Sphinx 1.7, please use docutils' instead.

RemovedInSphinx17Warning)

Extension error:
Could not import extension recommonmark (exception: No module named 'recommonmark')
Makefile:63: recipe for target 'html' failed
make: *** [html] Error 1

@sbenthall
Copy link
Contributor Author

This is because recommonmark is not included as a dependency in requirements.txt

@sbenthall
Copy link
Contributor Author

Fixing this requirements issue and rerunning make html results in this error:

$ make html
sphinx-build -b html -d ../../HARK-docs/doctrees   . ../../HARK-docs/html
Running Sphinx v1.6.7
3.6.8 |Anaconda custom (64-bit)| (default, Dec 30 2018, 01:22:34) 
[GCC 7.3.0]
Inserting /home/sb/projects/econ-ark/HARK
/home/sb/anaconda3/lib/python3.6/site-packages/sphinx/util/compat.py:40: RemovedInSphinx17Warning: sphinx.util.compat.Directive is deprecated and will be removed in Sphinx 1.7, please use docutils' instead.
  RemovedInSphinx17Warning)
loading pickled environment... not yet created
/home/sb/projects/econ-ark/HARK/Documentation/notebooks/DCT-Copula-Illustration.rst: WARNING: document not readable. Ignored.
loading intersphinx inventory from https://docs.python.org/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
[autosummary] generating autosummary for: CONTRIBUTING.md, HARKmanual.md, HARKmanual/ContributingToHARK/ContributingToHARK.md, HARKmanual/HARKmanual.md, generated/HARK.BayerLuetticke.Assets.One.FluctuationsOneAssetIOUs.rst, generated/HARK.BayerLuetticke.Assets.One.FluctuationsOneAssetIOUsBond.rst, generated/HARK.BayerLuetticke.Assets.One.SharedFunc.rst, generated/HARK.BayerLuetticke.Assets.One.SharedFunc2.rst, generated/HARK.BayerLuetticke.Assets.One.SteadyStateOneAssetIOUs.rst, generated/HARK.BayerLuetticke.Assets.One.SteadyStateOneAssetIOUsBond.rst, ..., generated/HARK.BayerLuetticke.Assets.Two.SharedFunc3.rst, generated/HARK.BayerLuetticke.Assets.Two.SteadyStateTwoAsset.rst, generated/HARK.BayerLuetticke.Assets.Two.defineSSParametersTwoAsset.rst, generated/HARK.BayerLuetticke.ConsIndShockModel_extension.rst, index.rst, notebooks/Gentle-Intro-To-HARK.ipynb, notebooks/README.rst, packaging.md, readme.md, submodules/README.rst
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.Assets.One.Luetticke_wrapper': no module named HARK.BayerLuetticke.Assets.One.Luetticke_wrapper
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.Assets.Two.EX3SS_20_python2.p': no module named HARK.BayerLuetticke.Assets.Two.EX3SS_20_python2.p
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.Assets.Two.EX3SS_20_python3.p': no module named HARK.BayerLuetticke.Assets.Two.EX3SS_20_python3.p
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.BayerLuetticke_wrapper': no module named HARK.BayerLuetticke.BayerLuetticke_wrapper
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.notebooks.DCT': no module named HARK.BayerLuetticke.notebooks.DCT
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.notebooks.DCT.ipynb': no module named HARK.BayerLuetticke.notebooks.DCT.ipynb
WARNING: [autosummary] failed to import 'HARK.BayerLuetticke.notebooks.OneAsset': no module named HARK.BayerLuetticke.notebooks.OneAsset

Exception occurred:
  File "/home/sb/projects/econ-ark/HARK/HARK/BayerLuetticke/notebooks/TwoAsset.py", line 162, in <module>
    get_ipython().run_line_magic('matplotlib', 'auto')
NameError: name 'get_ipython' is not defined
The full traceback has been saved in /tmp/sphinx-err-p53q6tm1.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!
Makefile:63: recipe for target 'html' failed
make: *** [html] Error 1

As this seems to be due to an issue with a specific notebook and its rendering into the docs, and not the dependency incompatibility issues, I'm going to make a separate issue for this.

@llorracc
Copy link
Collaborator

llorracc commented Oct 24, 2019 via email

sbenthall added a commit to sbenthall/HARK that referenced this issue Oct 24, 2019
llorracc added a commit that referenced this issue Oct 24, 2019
fixes to requirements.txt to fix sphinx dependency errors. Fixes #406 #412
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

No branches or pull requests

2 participants