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

MkDocs build fails, AttributeError: module 'jinja2' has no attribute 'contextfilter' #9064

Closed
KanchiMoe opened this issue Mar 31, 2022 · 2 comments

Comments

@KanchiMoe
Copy link

KanchiMoe commented Mar 31, 2022

Details

Expected Result

Build should succeed, using the bare minimum configuration for an MkDocs documentation site.

Build has worked previously in the past (2 weeks ago) using the same configuration.

Actual Result

Build using MkDocs fails.

Build logs:

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/rtd-test-310322/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/rtd-test-310322/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/rtd-test-310322/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/rtd-test-310322/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/rtd-test-310322/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/rtd-test-310322/envs/latest/lib/python3.7/site-packages/mkdocs/utils/filters.py", line 11, in <module>
    @jinja2.contextfilter
AttributeError: module 'jinja2' has no attribute 'contextfilter'

This seems related to #9052 (and maybe pallets/jinja/pull/1544) when doing a search on this repo for contextfilter.

Some project settings:

  • Repository type: git
  • Programming Language: python
  • Documentation type: Mkdocs
  • Python Interpreter: CPython 3.x

This does not appear to impact Sphinx.

@stsewd
Copy link
Member

stsewd commented Mar 31, 2022

Hi, this is a problem with your dependencies, you need to pin Jinja2 or update your mkdocs version. mkdocs/mkdocs#2799 https://twitter.com/readthedocs/status/1507388916013314048

@stsewd stsewd closed this as completed Mar 31, 2022
@BurtHarris
Copy link

BurtHarris commented Apr 3, 2022

I'm seeing this same message after just having installed Docker on Win11 and running the Tutorial. I recognize this is not the Docker repository, but it is the place that a Bing search for the error message turns up first.

For anyone else, it seems the place to look if you are running Docker is
https://forums.docker.com/t/jinja-mkdocs-issue-breaks-docker101tutorial/122671

The workaround documented there worked for me.

jacobbieker added a commit to openclimatefix/nowcasting_dataset that referenced this issue Apr 8, 2022
dlek added a commit to dlek/medial that referenced this issue Jun 26, 2022
cruizba added a commit to OpenVidu/openvidu.io-docs that referenced this issue Jul 22, 2022
cruizba added a commit to OpenVidu/openvidu.io-docs that referenced this issue Jul 22, 2022
cruizba added a commit to OpenVidu/openvidu.io-docs that referenced this issue Jul 22, 2022
atifkarim added a commit to atifkarim/random_solution that referenced this issue Sep 22, 2022
error:  AttributeError: module 'jinja2' has no attribute 'contextfilter'
trial solution: readthedocs/readthedocs.org#9064 (comment)
made requirements.txt with: https://github.com/bndr/pipreqs
candlerb added a commit to candlerb/solis_exporter that referenced this issue Nov 27, 2022
candlerb added a commit to candlerb/solis_exporter that referenced this issue Nov 27, 2022
jymchng added a commit to jymchng/landuo that referenced this issue Jan 15, 2023
jymchng added a commit to jymchng/landuo that referenced this issue Jan 15, 2023
kspalaiologos added a commit to kspalaiologos/kamilalisp that referenced this issue Jan 27, 2023
Otto-AA added a commit to Otto-AA/solid-client-credentials-py that referenced this issue Feb 19, 2023
this fixes an issue when building on readthedocs
see readthedocs/readthedocs.org#9064
Otto-AA added a commit to Otto-AA/solid-client-credentials-py that referenced this issue Feb 19, 2023
this fixes an issue when building on readthedocs
see readthedocs/readthedocs.org#9064
Otto-AA added a commit to Otto-AA/solid-client-credentials-py that referenced this issue Feb 19, 2023
this fixes an issue when building on readthedocs
see readthedocs/readthedocs.org#9064
ArjoNagelhout added a commit to ShapeReality/cuboid-docs that referenced this issue Apr 15, 2023
stevengj added a commit to NanoComp/meep that referenced this issue May 12, 2023
btjanaka added a commit to btjanaka/logdir that referenced this issue Jun 16, 2023
btjanaka added a commit to btjanaka/logdir that referenced this issue Jun 16, 2023
saheerb pushed a commit to saheerb/ci-test that referenced this issue Jan 2, 2025
To workaround a known issue with mkdocs:
https://linaro.atlassian.net/browse/TFC-306
readthedocs/readthedocs.org#9064

Signed-off-by: Paul Sokolovsky <[email protected]>
Change-Id: I9707e4ab692b3357d68c6bcbf3f2f626378dc701
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

3 participants