Build failed: code error for my code in Readthedocs
Asked Answered
M

0

1

I am trying to link my Sphinx documentation with Readthedocs. I can build the documentation locally in my computer but when I try to have Readthedocs automatically generate the documentation I get the following error:

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/helstrom-quantum-centroid-classifier/envs/latest/lib/python3.7/site-packages/sphinx/config.py", line 368, in eval_config_file
    execfile_(filename, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/helstrom-quantum-centroid-classifier/envs/latest/lib/python3.7/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "/home/docs/checkouts/readthedocs.org/user_builds/helstrom-quantum-centroid-classifier/checkouts/latest/docs/conf.py", line 16, in <module>
    import sphinx_gallery
ModuleNotFoundError: No module named 'sphinx_gallery'

I have imported sphinx_gallery in my conf.py file as well as added the extension 'sphinx_gallery.gen_gallery'. My conf.py file is located here: https://github.com/leockl/helstrom-quantum-centroid-classifier/blob/master/docs/conf.py

And my Github project is located here: https://github.com/leockl/helstrom-quantum-centroid-classifier

Where have I gone wrong?

Marcelina answered 21/1, 2020 at 4:55 Comment(11)
Does this answer your question? readthedocs not creating documentation from public github repositoryLoreenlorelei
Hi @StevePiercy, thanks. I think I am one step closer now. From this link, the first paragraph says I need to "enable the virtualenv feature in the Admin page of your project". I can't seem to find this option in my Readthedocs project (readthedocs.org/dashboard/helstrom-quantum-centroid-classifier/…). Do you know where in the Admin page I can enable the virtualenv feature?Marcelina
I found the option to enable the virtualenv. But I now I am getting another error about cannot import name 'PackageFinder' from 'pip._internal.index' (though this is still an ImportError. Based on this link, shouldn't enabling virtualenv resolve all ImportError issues?Marcelina
Did you read my answer to the previously linked question?Loreenlorelei
Thanks, yeah I did and as a result I have enabled the virtualenv based on the FAQ part in the link. Can I ask what is Pyramid and if that applies to my situation?Marcelina
Do you also know what is this error ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/home/docs/checkouts/readthedocs.org/user_builds/helstrom-quantum-centroid-classifier/envs/latest/lib/python3.7/site-packages/pip/_internal/index/__init__.py) telling me in my Readthedocs build. Perhaps this will point me to a direction. Many thanksMarcelina
Pyramid here serves as an example of how to set up your repo to build on RTD. In whatever file you declare your requirements, you need to include required packages.Loreenlorelei
Thanks @StevePiercy. I have tried what was suggested in this link but I am still having the same error. Because the error ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/home/docs/checkouts/readthedocs.org/user_builds/helstrom-quantum-centroid-classifier/envs/latest/lib/python3.7/site-packages/pip/_internal/index/__init__.py) mentions the file `__init__.py', could it be something to do with an error in this file?Marcelina
it turns out there was a bug in pip that was fixed. Here's a link to the solution: https://mcmap.net/q/532080/-read-the-docs-build-fails-with-quot-cannot-import-name-39-packagefinder-39-from-39-pip-_internal-index-39-quotLoreenlorelei
Hi @StevePiercy, thanks for keeping an eye out and getting back. Yes, I can confirm the solution worked and I can now create docs in Readthedocs. Many thanks again!Marcelina
Does this answer your question? Read-the-docs build fails with "cannot import name 'PackageFinder' from 'pip._internal.index'"Madalena

© 2022 - 2024 — McMap. All rights reserved.