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

ReadTheDocs Cython ImportError: Cannot import module ... #14

Closed
danielhanchen opened this issue Jan 7, 2019 · 0 comments
Closed

ReadTheDocs Cython ImportError: Cannot import module ... #14

danielhanchen opened this issue Jan 7, 2019 · 0 comments

Comments

@danielhanchen
Copy link
Collaborator

This is just a post to highlight how the problem has been solved. Building locally works, however within RTD, the error showcases WARNING: autodoc: failed to import module 'hyperlearn.base'; the following exception was raised:
No module named 'hyperlearn.cython.base'

I've checked: https://stackoverflow.com/questions/13238736/how-to-document-cython-function-on-readthedocs/13364247, https://stackoverflow.com/questions/13372068/importerror-for-my-code-on-readthedocs, https://stackoverflow.com/questions/10324393/sphinx-build-fail-autodoc-cant-import-find-module, readthedocs/readthedocs.org#3634, readthedocs/readthedocs.org#2511, https://docs.readthedocs.io/en/latest/faq.html, astropy/astropy-healpix#4, and mozilla/treeherder@f17bcf8.

All didn't solve the problem. To solve it, in conf.py change
sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('../../'))

to sys.path.insert(0, os.path.abspath('.hyperlearn'))

Only the one line is enough to fix the problem!

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

1 participant