quarto-dev / quarto-cli

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

Missing Python dependencies in Ubuntu #2147

Closed plantarum closed 2 years ago

plantarum commented 2 years ago

Bug description

I am trying to run Quarto for the first time. I have installed the deb package on my Ubuntu Focal machine. My first attempt to render the hello.qmd test file failed:

.../quarto/tutorial quarto render hello.qmd --to html

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

I resolved this with the following:

apt-get install python3-pip
python3 -m pip install nbclient

My next attempt to render failed with a new message:

quarto render hello.qmd --to html

Starting python3 kernel...ERROR: 

No such kernel named python3

I'm not sure how to resolve this. Is there a list of Python dependencies for Quarto somewhere, and ideally instructions for installation that non-Python programmers can follow?

Maybe helpful:

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",
    "materia",
    "lux",
    "superhero",
    "quartz",
    "united",
    "sandstone",
    "spacelab",
    "solar",
    "journal",
    "minty",
    "sketchy",
    "cosmo",
    "flatly",
    "vapor",
    "darkly",
    "yeti",
    "cerulean",
    "lumen",
    "litera",
    "morph",
    "slate",
    "cyborg",
    "simplex",
    "pulse",
    "zephyr"
  ],
  "python": {
    "versionMajor": 3,
    "versionMinor": 8,
    "versionPatch": 10,
    "versionStr": "3.8.10 (default, Jun 22 2022, 20:18:18)  [GCC 9.4.0]",
    "conda": false,
    "execPrefix": "/usr",
    "executable": "/usr/bin/python3",
    "jupyter_core": "4.11.1",
    "nbformat": "5.0.4",
    "nbclient": "0.6.7",
    "ipykernel": null,
    "pyLauncher": false,
    "kernels": [
      {
        "display_name": "Python 3",
        "language": "python",
        "name": "python3"
      }
    ],
    "venv": true
  }
}

Checklist

cscheid commented 2 years ago

The requirements are described here: https://quarto.org/docs/computations/python.html#installation

Can you run quarto check jupyter?

plantarum commented 2 years ago

That fixed it, thanks!

quarto check jupyter reported many errors first time. Then I ran

python3 -m pip install jupyter

as per the instructions, and it fixed the issues:

quarto check jupyter

[✓] Checking Python 3 installation....OK
      Version: 3.8.10
      Path: /usr/bin/python3
      Jupyter: 4.11.1
      Kernels: python3

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

And now I can render the hello.qmd file without issue.

Perhaps it would be helpful to include this requirement in the "Tutorial: Hello, Quarto" lesson, since it comes before the Python computation lesson in the sequence beginners are likely to follow? Or have I overlooked something?

Thanks,

Tyler

cscheid commented 2 years ago

That's a good point, thanks. I updated those places on the webpage, and the change should appear soon.