readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.02k stars 3.58k forks source link

Cannot find module when mkdocs tries to build the site #11176

Closed dmundra closed 7 months ago

dmundra commented 7 months ago

Details

Expected Result

Our builds were working, see this example https://readthedocs.org/projects/civicactions-handbook/builds/23494880/

Actual Result

But then for this https://readthedocs.org/projects/civicactions-handbook/builds/23605796/ and subsequent builds we get this error:

Error: MkDocs encountered an error parsing the configuration file: while constructing a Python object
cannot find module 'materialx.emoji' (No module named 'materialx')
  in ".config/mkdocs.yml", line 22, column 22

I am not sure why and we haven't changed the configuration. I am testing upgrading Materials theme but running into a different module that cannot be found.

Am I missing anything in the mkdocs configuration that is causing the issue?

agjohnson commented 7 months ago

This is a bug introduced with Poetry 1.8:

You can find the explanation and a workaround there

stsewd commented 7 months ago

The solution is documented in our docs at https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry

dmundra commented 7 months ago

Thank you @agjohnson and @stsewd. The addition of VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH to the install step fixed it for us.