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

Read The Docs automodule not working when I'm building it with rtd. but works when I build it with **make html** command #4210

Closed
jtpaquet opened this issue Jun 8, 2018 · 3 comments
Labels
Support Support question

Comments

@jtpaquet
Copy link

jtpaquet commented Jun 8, 2018

Details

Hi,
I'm having trouble documenting a class with the autoclass command. I specified where are my source files and I don't get import errors that tell me Sphinx is not finding my module. I think I'm getting this part right because when I go in the docs folder and I enter the command:
$ make html
the html files build well and I get what I want, which is this class documented.

make html

When I build it with Read The Docs to have it hosted on https://picamera-gui.readthedocs.io/en/latest/code.html#picameragui-py, I don't get any error, but the class is not displayed.

build rtd

In the admin settings of my Read The Docs project, I specified a requirements.txt file that I built with
$ pip freeze > requirements.txt
admin settings

I also didn't check the Install your project inside a virtualenv using setup.py install box because I don't have a setup.py file in my folder and I don't know how I can install a virtual environment. When I check the box, I get this error in my Read The Docs builds

setup py

I think I'm missing something and if somebody knows rapidly what I'm doing wrong, it would be great.

If I forgot information that might help you finding my problem, here is my deposit:
https://github.com/jtpaquet/PiCamera-GUI

Thank you,
Jérémy Talbot-Pâquet

PS: Sorry for the documentation in French

@stsewd stsewd added the Support Support question label Jun 8, 2018
@stsewd
Copy link
Member

stsewd commented Jun 8, 2018

You have a warning in your build https://readthedocs.org/api/v2/build/7316389.txt line 558

WARNING: autodoc: failed to import class u'PiCameraGUI' from module u'PiCameraGUI'; the following exception was raised:
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/envs/latest/local/lib/python2.7/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/checkouts/latest/picamera-gui/PiCameraGUI.py", line 12, in <module>
    from picamera import PiCamera
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/envs/latest/local/lib/python2.7/site-packages/picamera/__init__.py", line 72, in <module>
    from picamera.exc import (
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/envs/latest/local/lib/python2.7/site-packages/picamera/exc.py", line 41, in <module>
    import picamera.mmal as mmal
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/envs/latest/local/lib/python2.7/site-packages/picamera/mmal.py", line 47, in <module>
    from .bcm_host import VCOS_UNSIGNED
  File "/home/docs/checkouts/readthedocs.org/user_builds/picamera-gui/envs/latest/local/lib/python2.7/site-packages/picamera/bcm_host.py", line 47, in <module>
    _lib = ct.CDLL('libbcm_host.so')
  File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libbcm_host.so: cannot open shared object file: No such file or directory

I think you need this https://docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules

@jtpaquet
Copy link
Author

Thanks a lot! I didn't think there was any problems, because it was building. I already had my packages imported this way, but i forgot to add 'picamera'. Here in my conf.py.

solved

It was probably building with make html because Python was able to locate the 'picamera' package, but Read The Docs didn't beacause I didn't specify it.

If anybody has their project building with the make html command, but not with Read The Docs, click on view raw in your Read The Docs build to ensure there is not something missing.

@yangliu2
Copy link

You need to include your package link from github in requirements.txt file inside of the docs folder. If ReadTheDoc doesn't have access to your code, then it can't do autodoc. You would think they would have the code since they already pulled from github, but they don't. My inspiration came from this page. #7156

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

3 participants