attributeerror: module mistune has no attribute blockgrammar error’s cause is incompatibility of nbconvert and mistune package. In this article we will explore the best ways to fix this error. The mistune module is a markdown parser and nbconvert is useful in converting notebook into the different template. Lets start the solutioning of this error.
Attributeerror: module mistune has no attribute blockgrammar ( Solution )-
Actually this type of attributeerror mainly occurs in specific version of the module. Lets say in specific version of mistune we have a list of attributes. But later on some version , All these are removed or path is changed. If we do not change the invoking order then it will throw the atributeerror. Hence the best way to fix this error is upgrade or downgrade incompatible packages.
1.Incompatibility removal with pip –
Since pip is the best package manager which we use to upgrade or downgrade any python module. Since we need to install the specific version for mistune and nbconvert then we will run the below command.
pip install --upgrade 'nbconvert>=7' 'mistune>=2'
The above pip command will install nbconvert module with version greater than 7 and mistune also greater than 2. Infact if also upgrade these packages to the latest then it will resolve the issue.
2.Incompatibility removal with conda –
Conda is also a similar package manger like pip. Mostly in Analytics people use Anaconda distribution, there conda is default package manager. We can also upgrade any package with conda manager. Here is the command for upgrading both the package.
conda install -c conda-forge 'nbconvert>=7' 'mistune>=2`
If you want to understand the basic principles of attributeerror resolution then explore the below article. It will give a complete grip on similar type of attributeerror resolution. It has multiple example for exploration as well.
Hope after reading this article, you can resolve your error easily.
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.