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

Start getting No module named error without documentation changes #8326

Closed
takuseno opened this issue Jul 7, 2021 · 8 comments
Closed

Start getting No module named error without documentation changes #8326

takuseno opened this issue Jul 7, 2021 · 8 comments
Labels
Support Support question

Comments

@takuseno
Copy link

takuseno commented Jul 7, 2021

Details

The build of my readthedocs project suddenly start failing due to no module named xxx.
Although the previous build succeeded, I cannot see any significant changes to break the build.

Expected Result

Actual Result

@astrojuanlu
Copy link
Contributor

Hi @takuseno ! Well, at first glance this looks weird. I see that both installed d3rlpy 0.90:

  Building wheel for d3rlpy (setup.py): started
  Building wheel for d3rlpy (setup.py): finished with status 'done'
  Created wheel for d3rlpy: filename=d3rlpy-0.90-cp37-cp37m-linux_x86_64.whl

And they both use the same version of Sphinx. We'll keep investigating.

@humitos humitos added the Support Support question label Jul 7, 2021
@takuseno
Copy link
Author

takuseno commented Jul 8, 2021

@aseering Thank you!

@astrojuanlu
Copy link
Contributor

Sorry for the delay. I am debugging this locally now, and found this error:

>>> import d3rlpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/__init__.py", line 6, in <module>
    from . import (
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/algos/__init__.py", line 3, in <module>
    from .awac import AWAC
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/algos/awac.py", line 3, in <module>
    from ..argument_utility import (
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/argument_utility.py", line 6, in <module>
    from .models.encoders import EncoderFactory, create_encoder_factory
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/models/__init__.py", line 1, in <module>
    from . import encoders, optimizers, q_functions
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/models/encoders.py", line 8, in <module>
    from .torch import (
  File "/home/docs/checkouts/readthedocs.org/user_builds/d3rlpy/envs/latest/lib/python3.7/site-packages/d3rlpy/models/torch/__init__.py", line 29, in <module>
    from .q_functions import (
ModuleNotFoundError: No module named 'd3rlpy.models.torch.q_functions'

There seems to be an installation issue, which was kind of masked by the original No module named errors. I keep investigating.

@astrojuanlu
Copy link
Contributor

I volunteered to fix some packaging problems of d3rlpy here takuseno/d3rlpy#97

However, even after doing that, I still get these errors:

[autosummary] generating autosummary for: cli.rst, getting_started.rst, index.rst, installation.rst, license.rst, notebooks.rst, references/algos.rst, references/dataset.rst, references/datasets.rst, references/index.rst, ..., references/
off_policy_evaluation.rst, references/online.rst, references/optimizers.rst, references/preprocessing.rst, references/q_functions.rst, references/save_and_load.rst, references/sb3.rst, references/sklearn.rst, reproductions.rst, tips.rst
WARNING: [autosummary] failed to import 'd3rlpy.algos.AWAC': no module named d3rlpy.algos.AWAC                                                                                                                                                
WARNING: [autosummary] failed to import 'd3rlpy.algos.AWR': no module named d3rlpy.algos.AWR                                                                                                                                                  WARNING: [autosummary] failed to import 'd3rlpy.algos.BC': no module named d3rlpy.algos.BC                                                                                                                                                    WARNING: [autosummary] failed to import 'd3rlpy.algos.BCQ': no module named d3rlpy.algos.BCQ 

which makes total sense, because:

>>> import d3rlpy.algos.AWAC
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'd3rlpy.algos.AWAC'

however:

>>> from d3rlpy.algos import AWAC
>>>

Therefore, apart from the setup.py fixes, I think there is some misconfiguration in your autodoc or autosummary templates.

To the question of why it was working before, I can't tell. When I first checked this issue a few days ago, the dependencies were the same between both builds. But the problem is not specific to Read the Docs in any case.

@astrojuanlu astrojuanlu added the Needed: more information A reply from issue author is required label Jul 20, 2021
@takuseno
Copy link
Author

@astrojuanlu Wow! Thanks for the investigation!! This makes a lot of sense! Regarding the d3rlpy.algos.AWAC, it's weird since it worked before. And, it can be initialized like this.

import d3rlpy
awac = d3rlpy.algos.AWAC()

This is not sufficient to generate autodoc?

@no-response no-response bot removed the Needed: more information A reply from issue author is required label Jul 20, 2021
@astrojuanlu
Copy link
Contributor

It is, but it's trying to import the AWAC module rather than the class. I'll see if I can give you more pointers :)

@astrojuanlu
Copy link
Contributor

Problem fixed in takuseno/d3rlpy#97. It was not a Read the Docs issue, but it was very hard to tell looking at the Sphinx traceback. I suspect we have similar issues to this one, so will try to improve the situation upstream.

Closing, feel free to open a new issue if you still need help.

@takuseno
Copy link
Author

@astrojuanlu Thanks for the fix!! That helps me a lot!!!!

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