Skip to content

mkdocs python parser is failing when building the pages #9774

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
Monallabs opened this issue Dec 3, 2022 · 1 comment
Closed

mkdocs python parser is failing when building the pages #9774

Monallabs opened this issue Dec 3, 2022 · 1 comment

Comments

@Monallabs
Copy link

Details

Expected Result

I am not sure if I am doing the steps correctly. I wrote some docs in markdown under docs/ folder
of my github project. Then used mkdocs build and mkdocs gh-deploy to push to github under gh-pages branch.

On readthedocs, after registering the project, and selected documentation type as mkdocs. The build starts
but crashes.

A description of what you wanted to happen
I hoped to build process to report invalid format or the build to complete

Actual Result

An error due to jinja2 parsing.

The actual output:


Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/3.7.9/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/docs/.pyenv/versions/3.7.9/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/__main__.py", line 14, in <module>
    from mkdocs import config
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/config/__init__.py", line 2, in <module>
    from mkdocs.config.defaults import DEFAULT_SCHEMA
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/config/defaults.py", line 4, in <module>
    from mkdocs.config import config_options
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/config/config_options.py", line 8, in <module>
    from mkdocs import utils, theme, plugins
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/theme.py", line 9, in <module>
    from mkdocs.utils import filters
  File "/home/docs/checkouts/readthedocs.org/user_builds/addict-tracking-changes/envs/latest/lib/python3.7/site-packages/mkdocs/utils/filters.py", line 11, in <module>
    @jinja2.contextfilter
AttributeError: module 'jinja2' has no attribute 'contextfilter'

A description of what actually happened
The build engine broke.

@humitos
Copy link
Member

humitos commented Dec 5, 2022

Hi @Monallabs! Thanks for reporting this issue. It looks duplicated of #9081. Please, use the latest version of MkDocs for building your documentation.

@humitos humitos closed this as completed Dec 5, 2022
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

2 participants