Skip to content

Python 3.6: autodoc page builds locally, but is empty on readthedocs.org #7220

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

Closed
jnecus opened this issue Jun 23, 2020 · 4 comments
Closed
Labels
Support Support question

Comments

@jnecus
Copy link

jnecus commented Jun 23, 2020

Details

Appears similar to the following issue #3634 , but not caused by the same issue seemingly.

Expected Result

I am attempting to build documentation for my project. When I build locally, autodoc produces API documentation, so I would expect that the same result on readthedocs.org, or that inspecting the build output for the project would reveal errors.

Actual Result

The build output provides the following:


WARNING: autodoc: failed to import module 'ukbio' from module 'ukbiobank'; the following exception was raised:
No module named 'ukbiobank.utils'
WARNING: autodoc: failed to import module 'utils.ukbio_utils' from module 'ukbiobank'; the following exception was raised:
No module named 'ukbiobank.utils'
WARNING: autodoc: failed to import module 'filtering.ukbio_filtering' from module 'ukbiobank'; the following exception was raised:
No module named 'ukbiobank.utils'
WARNING: autodoc: failed to import module 'ukbio_utils' from module 'ukbiobank'; the following exception was raised:
No module named 'ukbiobank.utils'

@stsewd
Copy link
Member

stsewd commented Jun 23, 2020

You need to have installed the same packages as you do locally, please check https://docs.readthedocs.io/en/stable/guides/specifying-dependencies.html#specifying-dependencies

@stsewd stsewd added Needed: more information A reply from issue author is required Support Support question labels Jun 23, 2020
@jnecus
Copy link
Author

jnecus commented Jun 23, 2020

The package ukbiobank-tools appears to be installing successfully.

I have managed to isolate this issue in the following way

If I remove from .utils import getFieldsInstancesArrays from the beginning of the ukbio.py file, then automodule works correctly:

I.e. by commenting out the first line in ukbio.py

#from .utils import getFieldsInstancesArrays
import pandas as pd
import os

The following sphinx autodoc works:


.. automodule:: ukbiobank.ukbio
    :members:

However, this line is necessary for proper functioning of the ukbiobank-tools package. The thing that I can't understand is why when installing and building locally there appears to be no problem. It is not a case of sphinx not being able to install or see ukbiobank-tools , rather it appears to be cause by the importing within the ukbiobank-tools package.

@no-response no-response bot removed the Needed: more information A reply from issue author is required label Jun 23, 2020
@stsewd
Copy link
Member

stsewd commented Jun 23, 2020

@jnecus
Copy link
Author

jnecus commented Jun 24, 2020

I have managed to solve this now by fixing an issue with relative imports within the ukbiobank-tools python package.

@stsewd Thank you very much for your help, I appreciate your fast responses.

@jnecus jnecus closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

2 participants