quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.89k stars 320 forks source link

No module named 'nbformat' #1923

Open afsilvad opened 2 years ago

afsilvad commented 2 years ago

Bug description

First of all I want to clarify that this is my first post here, I apologize if it's not completely clear.

Once I got to know Quarto I wanted to start experimenting with it working with Python, however, I have not been able to because the nbformat package is not installed. However, when I check the list of installed packages this package appears there in both the conda and pip package lists. Can anyone tell me what the problem is? I have tried RStudio and VS code but I have the same issue with both.

OS: Ubuntu 20.04.4 LTS RStudio Version: 2022.07.1 VS code Version: 1.70.1

Console output when I want to Render the document:

(base) ..$ quarto preview quarto_test.qmd --to html --no-browser --no-watch-inputs

Starting python3 kernel...Traceback (most recent call last): File "/opt/quarto/share/jupyter/jupyter.py", line 21, in from notebook import notebook_execute, RestartKernel File "/opt/quarto/share/jupyter/notebook.py", line 16, in import nbformat ModuleNotFoundError: No module named 'nbformat'

nbformat package in pip list:

nbformat package in conda list:

qmd file content:


title: "Quarto test" author: "Andrés Silva" format: html jupyter: python3

Quarto

Quarto enables you to weave together content and executable code into a finished docquartoument. To learn more about Quarto see https://quarto.org.

Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

1 + 1

You can add options to executable code like this

#| echo: false
2 * 2

The echo: false option disables the printing of code (only output is displayed).

quarto check Output

[✓] Checking Quarto installation......OK Version: 1.0.38 Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK Version: 3.9.5 (Conda) Path: /home/afsilvad/miniconda3/bin/python Jupyter: 4.10.0 Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK Version: 4.2.1 Path: /usr/lib/R LibPaths:

[✓] Checking Knitr engine render......OK

quarto tools check Output

Tool Status Installed Latest
chromium Not installed --- 869685
tinytex Not installed --- v2022.08

jjallaire commented 2 years ago

It may be that the version of Python that Quarto is binding to doesn't have jupyter (or consequently nbformat). What is the output of the following command: quarto capabilities ?

afsilvad commented 2 years ago

@jjallaire Thank you for your response. This is the output of quarto capabilities.

{ "formats": [ "html", "pdf", "docx", "odt", "pptx", "beamer", "revealjs", "gfm", "hugo", "epub", "asciidoc", "asciidoctor", "commonmark", "commonmark_x", "context", "docbook", "docbook4", "docbook5", "dokuwiki", "dzslides", "epub2", "epub3", "fb2", "haddock", "html4", "html5", "icml", "ipynb", "jats", "jats_archiving", "jats_articleauthoring", "jats_publishing", "jira", "json", "latex", "man", "markdown", "markdown_github", "markdown_mmd", "markdown_phpextra", "markdown_strict", "markua", "mediawiki", "ms", "muse", "native", "opendocument", "opml", "org", "plain", "rst", "rtf", "s5", "slideous", "slidy", "tei", "texinfo", "textile", "xwiki", "zimwiki" ], "themes": [ "default", "minty", "cosmo", "lumen", "materia", "pulse", "morph", "cerulean", "united", "superhero", "zephyr", "sandstone", "solar", "simplex", "slate", "quartz", "lux", "spacelab", "cyborg", "sketchy", "litera", "vapor", "yeti", "journal", "darkly", "flatly" ], "python": { "versionMajor": 3, "versionMinor": 9, "versionPatch": 5, "versionStr": "3.9.5 (default, Jun 4 2021, 12:28:51) [GCC 7.5.0]", "conda": true, "execPrefix": "/home/afsilvad/miniconda3", "executable": "/home/afsilvad/miniconda3/bin/python", "jupyter_core": "4.10.0", "nbformat": "5.4.0", "nbclient": "0.5.13", "ipykernel": "6.9.1", "pyLauncher": false, "kernels": [ { "name": "python3", "language": "python", "display_name": "Python 3 (ipykernel)" } ], "venv": false }

jjallaire commented 2 years ago

I am not at all sure what's going on then as it does appears as if that package is installed and available.

ilovedata commented 1 year ago

I had the exactly same error, tried to fix it by installing jupyer again... but, still same error. So I completely delete Julia in my iMac Pro(intel) and install Julia with juliaup. Then, quarto works with Julia.