-
Notifications
You must be signed in to change notification settings - Fork 568
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
Getting Error when running nbconvert command : ImportError: cannot import name 'contextfilter' from 'jinja2' #1742
Comments
I'm running into this too |
I'm running into this too. Would really appreciate some help |
I did
|
Also ran into this issue with EDIT: a workaround for me was to upgrade to the latest version ( |
as the title suggests, we'll be trying to ensure better coverage of this in the future, and stay as compatible as possible, but as a tool and a library relied upon by other packages, it's rather hard for us to just blanket pin dependency versions, see #1740.
As has been suggested in a number of places related to this, if you start hard pinning individual values of dependencies, you likely need to pin, and check in, a complete solution to your environment, including all transient dependencies, and critically evaluate when you are forced to re-solve, e.g. because of security concerns. A number of tools make this more tractable, such as: |
…patibility with nbconvert v6.0.1) jupyter/nbconvert#1742
Still seeing this issue with nbconvert 6.5.0. Had to pin jinja2<3.1. |
|
Should address ImportError: cannot import name 'contextfilter' from 'jinja2' ref: jupyter/nbconvert#1742
|
same issue rn on a new environment with everything baseline other than intel-pytorch-extension. in genral this is really anoying because its on jupyter notebook which I use for alot of things and i see this error once a month |
this actually worked! thanks |
When running nbconvert command getting below error :
Stack Trace:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-nbconvert", line 5, in
from nbconvert.nbconvertapp import main
File "/usr/local/lib/python3.7/site-packages/nbconvert/init.py", line 4, in
from .exporters import *
File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/init.py", line 3, in
from .html import HTMLExporter
File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 14, in
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/usr/local/lib/python3.7/site-packages/jinja2/init.py)
Command:
jupyter nbconvert --execute --TemplateExporter.exclude_input=True --stdout --no-input --inplace --allow-errors --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python /test.ipynb
Nbconvert version:
nbconvert 6.1.0
Other dependencies used:
Package Version
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asn1crypto 1.5.1
atomicwrites 1.4.0
attrs 21.4.0
awscli 1.16.263
azure-common 1.1.28
azure-core 1.23.0
azure-storage-blob 12.11.0
backcall 0.2.0
beautifulsoup4 4.10.0
bleach 4.1.0
boto3 1.9.253
botocore 1.12.253
cattrs 1.1.2
certifi 2020.12.5
cffi 1.15.0
chardet 3.0.4
charset-normalizer 2.0.12
click 8.1.0
colorama 0.4.1
configparser 5.0.1
cryptography 3.4.8
csvdiff 0.3.3
debugpy 1.6.0
decorator 5.1.1
defusedxml 0.7.1
docutils 0.15.2
entrypoints 0.4
idna 2.10
importlib-metadata 4.11.3
importlib-resources 5.6.0
ipykernel 6.10.0
ipython 7.32.0
ipython-genutils 0.2.0
isodate 0.6.1
jedi 0.18.1
Jinja2 3.1.1
jmespath 0.10.0
json5 0.9.6
jsonschema 4.4.0
jupyter-client 7.2.0
jupyter-contrib-core 0.3.3
jupyter-contrib-nbextensions 0.5.1
jupyter-core 4.9.2
jupyter-highlight-selected-word 0.2.0
jupyter-latex-envs 1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyterlab 1.2.21
jupyterlab-pygments 0.1.2
jupyterlab-server 1.2.0
looker-sdk 7.20.0
lxml 4.8.0
MarkupSafe 2.1.1
matplotlib-inline 0.1.3
mistune 0.8.4
more-itertools 8.12.0
msrest 0.6.21
nbclient 0.5.13
nbconvert 6.1.0
nbformat 5.2.0
nest-asyncio 1.5.4
notebook 6.4.1
numpy 1.21.5
oauthlib 3.2.0
oscrypto 1.3.0
packaging 21.3
pandas 1.2.1
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pip 22.0.4
pluggy 0.13.1
prometheus-client 0.13.1
prompt-toolkit 3.0.28
psutil 5.9.0
ptyprocess 0.7.0
py 1.11.0
py4j 0.10.7
pyarrow 3.0.0
pyasn1 0.4.8
pycparser 2.21
pycryptodomex 3.14.1
Pygments 2.11.2
PyJWT 2.3.0
pyOpenSSL 19.1.0
pyparsing 3.0.7
pyrsistent 0.18.1
pyspark 2.4.0
pytest 4.6.5
python-dateutil 2.8.2
pytz 2020.5
PyYAML 5.1.2
pyzmq 22.3.0
redshift-connector 2.0.903
regex 2022.3.2
requests 2.27.1
requests-oauthlib 1.3.1
rsa 3.4.2
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
s3transfer 0.2.1
scramp 1.4.1
Send2Trash 1.8.0
setuptools 57.5.0
six 1.16.0
snowflake-connector-python 2.3.10
soupsieve 2.3.1
terminado 0.13.3
testpath 0.6.0
tornado 6.1
traitlets 5.1.1
typing_extensions 4.1.1
urllib3 1.25.11
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.37.1
zipp 3.7.0
Requirements.txt file:
pyspark==2.4.0
nbconvert==6.1.0
notebook==6.4.1
pandas==1.2.1
jupyterlab==1.2.21
jupyter_contrib_nbextensions==0.5.1
pytest==4.6.5
configparser==5.0.1
boto3
snowflake-connector-python==2.3.10
awscli==1.16.263
csvdiff
looker_sdk==7.20.0
ruamel.yaml
pyarrow~=3.0.0
redshift-connector==2.0.903
regex==2022.3.2
Please let me know how can I fix it
The text was updated successfully, but these errors were encountered: