Skip to content

Error from document-level caching with non-standard Jupyter kernel #9244

@allefeld

Description

@allefeld

While adapting my own ipykernel-based kernel for Matlab to the new support from Quarto, I tried document-level caching and ran into an error. To exclude a problem with my kernel, I tried with echo_kernel.

Minimal document cache.qmd:

---
jupyter: echo
execute:
  cache: true
---

```{echo}
2 + 2
```

The first processing works without a problem:

$ quarto preview cache.qmd --no-browser --no-watch-inputs

Starting echo kernel...Done

Executing 'cache.quarto_ipynb'

pandoc 
  to: html
  output-file: cache.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  
metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  jupyter: echo
  
Output created: cache.html

Watching files for changes
Browse at http://localhost:5271/

But on reprocessing (triggered by saving the file, but without changes ), this happens:

Starting echo kernel...ERROR: 

expected str, bytes or os.PathLike object, not builtin_function_or_method

To get more information:

$ quarto preview cache.qmd --no-browser --no-watch-inputs --execute-debug
- Connecting to kernel

Starting echo kernel...2024-03-30 00:43:19,923 - root - Level 25 - starting notebook server subprocess
2024-03-30 00:43:19,923 - root - Level 25 - starting notebook server subprocess
2024-03-30 00:43:20,175 - root - Level 25 - running notebook server subprocess
2024-03-30 00:43:20,175 - root - Level 25 - creating notebook server (tcp: /run/user/1000/jt/9a71d08a82b73a3b4e56)
2024-03-30 00:43:20,176 - root - Level 25 - notebook server bound to port 42867
- Kernel connection successful
2024-03-30 00:43:20,274 - root - Level 25 - handling server request
- Sending execute command to kernel
- Execute command sent, reading response
2024-03-30 00:43:20,285 - root - Level 25 - executing notebook
2024-03-30 00:43:20,285 - root - Level 25 - inside notebook_execute
2024-03-30 00:43:20,321 - root - Level 25 - notebook was read
2024-03-30 00:43:20,322 - root - Level 25 - {
  "name": "echo",
  "language": "text",
  "display_name": "Echo",
  "path": "/home/ca/.local/share/jupyter/kernels/echo"
}
2024-03-30 00:43:20,322 - root - Level 25 - No text directory found in /opt/quarto/share/jupyter/lang/text
2024-03-30 00:43:20,322 - root - Level 25 - Will look for explicit quarto setup cell information in kernelspec dir
2024-03-30 00:43:20,322 - root - Level 25 - No quarto_setup_cell file found in /home/ca/.local/share/jupyter/kernels/echo
2024-03-30 00:43:20,322 - root - Level 25 - /home/ca/.local/share/jupyter/kernels/echo/quarto_setup_cell
2024-03-30 00:43:20,323 - root - Level 25 - using cache
2024-03-30 00:43:20,323 - root - Level 25 - getting cache
- Error response received
ERROR: 

expected str, bytes or os.PathLike object, not builtin_function_or_method

Created from #9100 (comment).

Quarto check

$ quarto check
Quarto 1.5.27
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.27
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: 2022

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.12 (Conda)
      Path: /home/ca/Store/micromamba/envs/std/bin/python
      Jupyter: 5.3.1
      Kernels: python3, mkernel, echo

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

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /usr/lib/R
      LibPaths:
        - /home/ca/Store/R/4.3
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.45
      rmarkdown: 2.25

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingjupyter

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions