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

The nbconvert failed to execute the Kotlin notebook #401

Closed
KubaOfca opened this issue Mar 12, 2023 · 2 comments
Closed

The nbconvert failed to execute the Kotlin notebook #401

KubaOfca opened this issue Mar 12, 2023 · 2 comments
Labels
problem Some user problem that is not really a bug

Comments

@KubaOfca
Copy link

Description

By running notebook with Kotlin kernel with this command:

conda run jupyter nbconvert --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.allow_errors=False --to notebook --execute --inplace my-new-project-Kotlin/notebooks/notebook.ipynb

I notice this error:

Traceback (most recent call last):
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/bin/jupyter-nbconvert", line 6, in <module>
    from nbconvert.nbconvertapp import main
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/nbconvert/__init__.py", line 6, in <module>
    from . import filters, postprocessors, preprocessors, writers
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/nbconvert/filters/__init__.py", line 8, in <module>
    from .markdown import *
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/nbconvert/filters/markdown.py", line 13, in <module>
    from .markdown_mistune import markdown2html_mistune
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/nbconvert/filters/markdown_mistune.py", line 16, in <module>
    import bs4
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/bs4/__init__.py", line 37, in <module>
    from .builder import (
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/jvm/graalvm-189e927686-java17-22.3.0/languages/python/lib/python3.8/site-packages/bs4/builder/__init__.py", line 627, in <module>
    from . import _lxml
  File "/home/jakub/miniconda3/envs/my-new-project-Kotlin/lib/python3.8/site-packages/bs4/builder/_lxml.py", line 193
    if len(markup) > 0 and markup[0] == u'\N{BYTE ORDER MARK}':
                                        ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-18: unknown Unicode character name
ERROR conda.cli.main_run:execute(47): `conda run jupyter nbconvert --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.allow_errors=False --to notebook --execute --inplace my-new-project-Kotlin/notebooks/notebook.ipynb` failed. (See above for error)

As a result, notebook isn't executed.

Apart from executing notebook by nbconvert, executing it inside jupyter lab cell works fine without errors.

Expected behavior

Notebook is executed with nbconvert

Environment

Conda environment dependencies:

dependencies:
  - jupyterlab>=3.5.0
  - kotlin-jupyter-kernel>=0.11.0.15
  - openjdk>=17.0.5.8

@KubaOfca KubaOfca changed the title The nbconvert failed to execute the 'Kotlin' notebook The nbconvert failed to execute the Kotlin notebook Mar 12, 2023
@KubaOfca
Copy link
Author

Changing the dependency version to:

  - jupyterlab>=3.5.0
  - kotlin-jupyter-kernel>=0.11.0.255
  - openjdk>=17.0.3

solved the problem.

@ileasile
Copy link
Member

This trace looks like an environment problem, see, it fails on from . import _lxml. I believe it didn't even started to do something with the notebook at this point of time. But I'm glad that this problem got somehow fixed for you!

@ileasile ileasile added the problem Some user problem that is not really a bug label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Some user problem that is not really a bug
Projects
None yet
Development

No branches or pull requests

2 participants