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

Module 'mistune' has no attribute 'BlockGrammar' #40

Closed
thmsklngr opened this issue Sep 21, 2021 · 1 comment · Fixed by #43
Closed

Module 'mistune' has no attribute 'BlockGrammar' #40

thmsklngr opened this issue Sep 21, 2021 · 1 comment · Fixed by #43

Comments

@thmsklngr
Copy link

Hi,

I just wanted to generate some documentation of my current project and came across the problem mentioned in the topic. The log generated by Sphinx contains these lines:

# Sphinx version: 4.1.2
# Python version: 3.6.9 (CPython)
# Docutils version: 0.17.1 release
# Jinja2 version: 3.0.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/path/to/.virtualenvs/idme-JkYIOqhd/lib/python3.6/site-packages/sphinx/cmd/build.py", line 279, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/path/to/.virtualenvs/idme-JkYIOqhd/lib/python3.6/site-packages/sphinx/application.py", line 237, in __init__
    self.setup_extension(extension)
  File "/path/to/.virtualenvs/idme-JkYIOqhd/lib/python3.6/site-packages/sphinx/application.py", line 393, in setup_extension
    self.registry.load_extension(self, extname)
  File "/path/to/.virtualenvs/idme-JkYIOqhd/lib/python3.6/site-packages/sphinx/registry.py", line 429, in load_extension
    mod = import_module(extname)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/path/to/.virtualenvs/idme-JkYIOqhd/lib/python3.6/site-packages/m2r2.py", line 83, in <module>
    class RestBlockGrammar(mistune.BlockGrammar):
AttributeError: module 'mistune' has no attribute 'BlockGrammar'

I do not know if this might be related to m2r2 or Sphinx, however, whenever I enable m2r2 as extension in Sphinx, I get this error.

Regards, Thomas

@francois-maillard
Copy link

Looks like it is due to mistune bumping from 0.8.4 to 2.0.0, so forcing mistune==0.8.4 is a work around.

nhtzr added a commit to nhtzr/m2r2 that referenced this issue Dec 6, 2021
fmigneault added a commit to bird-house/birdhouse-deploy that referenced this issue Dec 7, 2021
fmigneault added a commit to bird-house/birdhouse-deploy that referenced this issue Dec 8, 2021
## Overview

- fix broken readthedocs build

## Changes

**Non-breaking changes**
n/a

**Breaking changes**
n/a

## Related Issue / Discussion

- Relates to:
  - readthedocs/readthedocs.org#8741
  - CrossNox/m2r2#40 
  - and other duplicates...
artoonie pushed a commit to artoonie/rcvformats that referenced this issue Dec 10, 2021
artoonie pushed a commit to artoonie/rcvformats that referenced this issue Dec 10, 2021
CrossNox pushed a commit that referenced this issue Dec 10, 2021
CrossNox added a commit that referenced this issue Dec 10, 2021
* force mistune to version 0.8.4 (#43)

closes #42 
closes #40

* pin

Co-authored-by: Ezequiel Rosas <nhtzr.rg@gmail.com>
jkoan added a commit to navit-gps/navit that referenced this issue Dec 17, 2021
RealOrangeOne added a commit to RealOrangeOne/zoloto that referenced this issue Dec 29, 2021
PeterSurda pushed a commit to Bitmessage/PyBitmessage that referenced this issue Jul 24, 2022
surbhicis pushed a commit to akeelahmedqureshi/PyBitmessage that referenced this issue Jul 29, 2022
CrossNox added a commit that referenced this issue Aug 11, 2022
* force mistune to version 0.8.4 (#43)

closes #42 
closes #40

* pin

* Remove calls to ErrorString and SafeString removed in docutils 0.19 (#49)

* remove python2

* fix pipelines

* fix linter pipeline

* set language for sphinx

* fix tests pipeline

* fix pipeline, set docutiles dependency

* why did I change this

* bump

Co-authored-by: Ezequiel Rosas <nhtzr.rg@gmail.com>
Co-authored-by: Ian Glen <ian@ianglen.me>
hoehnp pushed a commit to hoehnp/navit that referenced this issue Nov 20, 2022
CrossNox added a commit that referenced this issue Jan 30, 2023
* force mistune to version 0.8.4 (#43)

closes #42 
closes #40

* pin

* Remove calls to ErrorString and SafeString removed in docutils 0.19 (#49)

* remove python2

* fix pipelines

* fix linter pipeline

* set language for sphinx

* fix tests pipeline

* fix pipeline, set docutiles dependency

* why did I change this

* bump

* Added python_requires to setup.py (#56)

* fix quotes

---------

Co-authored-by: Ezequiel Rosas <nhtzr.rg@gmail.com>
Co-authored-by: Ian Glen <ian@ianglen.me>
Co-authored-by: Martin Pecka <peci1@seznam.cz>
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

Successfully merging a pull request may close this issue.

2 participants