<div dir="ltr">So I finally got the docs built. Couple of points which I think might be helpful to people building docs in the future:<br><ul><li>You need to have sphinx installed in your working environment (native installation, virtualenv, conda, whatever). I did not see sphinx listed as a dependency online. Maybe it should be included in the HACKING.rst.txt file?</li><li>You do <b>NOT</b> need to have numpydoc installed on your system. Irrespective of where it is installed, the build process only uses the numpydoc package present under the sphinxext directory. I wasted a lot of hours trying to find which version of numpydoc was being used as I had it installed both in my virtualenv, and native installation; neither of those had the faulty import line.</li><li>After using `git submodule update` to get the latest sphinxext directory and numpydoc installation, the faulty import line in file doc/sphinxext/numpydoc/numpydoc.py needs to be changed. From<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">from sphinx.util.compat import Directive<br></blockquote><div>to<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">from docutils.parsers.rst import Directive<br></blockquote><div>Thank you Lars for pointing that out.</div></div></li><li><div><div>Finally, and this was my fault entirely, I had my virtual environment running python version 3.5.2, but as python3 or python. Calling python3.5 (as the Makefile was doing when I set PYVER=3.5) called the python executable in /usr/bin/python3.5, which couldn't find the sphinx module itself (as I didn't install it along with my native installation). Setting PYVER=3, or PYTHON=/path/to/python/in/virtualenv fixed this.<br></div></div></li></ul></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 April 2018 at 03:40, Lars G. <span dir="ltr"><<a href="mailto:lagru@mailbox.org" target="_blank">lagru@mailbox.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 24.04.2018 20:36, Aditya Bharti wrote:<br>
> Regarding building the documentation, I was able to figure out that I<br>
> needed to install sphinx separately. The HACKING.rst.txt file only<br>
> mentions Numpy Cython and pytest as dependencies.<br>
> I was able to get the make command running with `make html PYVER=3.5`,<br>
> but I'm getting the follwing error:<br>
> <br>
> <br>
> Could not import extension numpydoc (exception: cannot import name<br>
> 'Directive')<br>
<br>
</span>Hello Aditya,<br>
<br>
I had the same problem with my setup. I'm still a little bit confused<br>
but I think the error was due to an old version of numpydoc trying use<br>
an import that didn't work with new versions of sphinx.<br>
I think got the old version with the git-submodules included in the<br>
doc-dirctory (can be downloaded with `git submodule update`).<br>
<br>
Anyway I got it to work by modifying the faulty import itself. Try to<br>
find the file numpydoc/numpydoc.py and try to find the line:<br>
<br>
from sphinx.util.compat import Directive<br>
<br>
If you can find that line you may be in luck because replacing that line<br>
with:<br>
<br>
from docutils.parsers.rst import Directive<br>
<br>
fixed it for me. I hope this helps.<br>
<br>
By the way, perhaps it would be useful to extend the doc/README.txt with<br>
a more thorough explanation of the build process and mention that the<br>
submodules can be downloaded with `git submodule update`. I only found<br>
out because I looked at guide for NumPy<br>
<a href="https://github.com/numpy/numpy/blob/master/doc/source/docs/howto_build_docs.rst" rel="noreferrer" target="_blank">https://github.com/numpy/<wbr>numpy/blob/master/doc/source/<wbr>docs/howto_build_docs.rst</a><br>
while trying to figure out the build process myself.<br>
<br>
Best regards,<br>
Lars<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scipy-dev</a><br>
</div></div></blockquote></div><br></div>