conda-forge / quarto-feedstock

A conda-smithy repository for quarto.
BSD 3-Clause "New" or "Revised" License
4 stars 9 forks source link

Quarto 1.3.x incompatible with jupyter_core 5.6.0 #34

Closed joelostblom closed 9 months ago

joelostblom commented 9 months ago

Solution to issue cannot be found in the documentation.

Issue

Follow up from https://github.com/quarto-dev/quarto/issues/341. It seems like quarto installed via conda does not recognize jupyter/jupyterlab installation in the same environment. See screenshot:

image

My shell is zsh and I don't have quarto installed outside this conda env (as can be seen in the screenshot as well).

Installed packages

# packages in environment at /home/joel/miniconda3/envs/jl:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
adagio                    0.2.4                    pypi_0    pypi
aiofiles                  23.2.1             pyhd8ed1ab_0    conda-forge
aiosqlite                 0.19.0             pyhd8ed1ab_0    conda-forge
antlr4-python3-runtime    4.11.1                   pypi_0    pypi
anyio                     4.2.0              pyhd8ed1ab_0    conda-forge
appdirs                   1.4.4                    pypi_0    pypi
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311h459d7ec_4    conda-forge
arrow                     1.2.3                    pypi_0    pypi
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
babel                     2.14.0             pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 2.0.0              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
bokeh                     3.3.2              pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                hd590300_1    conda-forge
brotli-bin                1.1.0                hd590300_1    conda-forge
brotli-python             1.1.0           py311hb755f60_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2023.11.17           hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2023.11.17         pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py311hb3a22ac_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.1.4              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0           py311h9547e67_0    conda-forge
cryptography              41.0.1                   pypi_0    pypi
dart-sass                 1.58.3               ha770c72_1    conda-forge
debugpy                   1.8.0           py311hb755f60_1    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
deno                      1.28.2               h2f28480_0    conda-forge
deno-dom                  0.1.35               hd9586b0_1    conda-forge
duckdb                    0.8.1                    pypi_0    pypi
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
esbuild                   0.19.2               ha770c72_0    conda-forge
exceptiongroup            1.2.0              pyhd8ed1ab_0    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
flit-core                 3.9.0              pyhd8ed1ab_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
fs                        2.4.16                   pypi_0    pypi
fugue                     0.8.5                    pypi_0    pypi
fugue-jupyter             0.2.3                    pypi_0    pypi
fugue-sql-antlr           0.1.6                    pypi_0    pypi
gmp                       6.3.0                h59595ed_0    conda-forge
greenlet                  3.0.0                    pypi_0    pypi
idna                      3.6                pyhd8ed1ab_0    conda-forge
importlib-metadata        7.0.1              pyha770c72_0    conda-forge
importlib_metadata        7.0.1                hd8ed1ab_0    conda-forge
importlib_resources       6.1.1              pyhd8ed1ab_0    conda-forge
ipykernel                 6.28.0             pyhd33586a_0    conda-forge
ipython                   8.19.0             pyh707e725_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
json5                     0.9.14             pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311h38be061_3    conda-forge
jsonschema                4.20.0             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.11.2          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.20.0             pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.1              pyhd8ed1ab_0    conda-forge
jupyter-ydoc              0.2.5                    pypi_0    pypi
jupyter_client            8.6.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.6.0           py311h38be061_0    conda-forge
jupyter_events            0.9.0              pyhd8ed1ab_0    conda-forge
jupyter_server            2.12.1             pyhd8ed1ab_0    conda-forge
jupyter_server_fileid     0.9.1              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.1              pyhd8ed1ab_0    conda-forge
jupyter_server_ydoc       0.1.4              pyhd8ed1ab_0    conda-forge
jupyter_ydoc              2.0.1              pyhd8ed1ab_0    conda-forge
jupyterlab                4.0.9              pyhd8ed1ab_0    conda-forge
jupyterlab-lsp            3.10.2                   pypi_0    pypi
jupyterlab-skip-traceback 5.0.0                    pypi_0    pypi
jupyterlab-vim            4.0.3                    pypi_0    pypi
jupyterlab_pygments       0.3.0              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.25.2             pyhd8ed1ab_0    conda-forge
jupyterlab_vim            4.1.0              pyhd8ed1ab_0    conda-forge
jupytext                  1.16.0             pyhd8ed1ab_0    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libblas                   3.9.0           20_linux64_openblas    conda-forge
libbrotlicommon           1.1.0                hd590300_1    conda-forge
libbrotlidec              1.1.0                hd590300_1    conda-forge
libbrotlienc              1.1.0                hd590300_1    conda-forge
libcblas                  3.9.0           20_linux64_openblas    conda-forge
libdeflate                1.19                 hd590300_0    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_3    conda-forge
libgfortran-ng            13.2.0               h69a702a_3    conda-forge
libgfortran5              13.2.0               ha4646dd_3    conda-forge
libgomp                   13.2.0               h807b86a_3    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           20_linux64_openblas    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.25          pthreads_h413a1c8_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsqlite                 3.44.2               h2797004_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_3    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
linkify-it-py             2.0.0              pyhd8ed1ab_0    conda-forge
markdown                  3.5.1              pyhd8ed1ab_0    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.3           py311h459d7ec_1    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mdit-py-plugins           0.4.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
nb_conda_kernels          2.3.1           py311h38be061_2    conda-forge
nbclassic                 1.0.0              pyhb4ecaf3_1    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.13.1             pyhd8ed1ab_0    conda-forge
nbconvert-core            7.13.1             pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.13.1             pyhd8ed1ab_0    conda-forge
nbformat                  5.9.2              pyhd8ed1ab_0    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nest-asyncio              1.5.8              pyhd8ed1ab_0    conda-forge
notebook                  7.0.6              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
numpy                     1.26.2          py311h64a7726_0    conda-forge
openjpeg                  2.5.0                h488ebb8_3    conda-forge
openssl                   3.2.0                hd590300_1    conda-forge
overrides                 7.4.0              pyhd8ed1ab_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    2.1.4           py311h320fe9a_0    conda-forge
pandoc                    3.1.1                h32600fe_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panel                     1.3.6              pyhd8ed1ab_0    conda-forge
param                     2.0.1              pyhca7485f_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pdfannots                 0.4                      pypi_0    pypi
pdfminer-six              20221105                 pypi_0    pypi
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.1.0          py311ha6c5da5_0    conda-forge
pip                       23.3.2             pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.1.0              pyhd8ed1ab_0    conda-forge
playwright                1.39.0                   pypi_0    pypi
prometheus_client         0.19.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
prompt_toolkit            3.0.42               hd8ed1ab_0    conda-forge
psutil                    5.9.7           py311h459d7ec_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pyarrow                   12.0.1                   pypi_0    pypi
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pycrdt                    0.8.2           py311h46250e7_0    conda-forge
pyee                      11.0.1                   pypi_0    pypi
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pyppeteer                 1.0.2                    pypi_0    pypi
pyrsistent                0.20.0          py311h459d7ec_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.7          hab00c5b_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.0             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    4_cp311    conda-forge
pytz                      2023.3.post1       pyhd8ed1ab_0    conda-forge
pyviz_comms               3.0.0              pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.1           py311h459d7ec_1    conda-forge
pyzmq                     25.1.2          py311h34ded2d_0    conda-forge
qpd                       0.4.3                    pypi_0    pypi
quarto                    1.3.450              ha770c72_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.32.0             pyhd8ed1ab_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rpds-py                   0.15.2          py311h46250e7_0    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
sqlglot                   16.4.2                   pypi_0    pypi
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
terminado                 0.18.0             pyh0d859eb_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.3.3           py311h459d7ec_1    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.0             pyhd8ed1ab_0    conda-forge
triad                     0.9.0                    pypi_0    pypi
types-python-dateutil     2.8.19.14          pyhd8ed1ab_0    conda-forge
typing-extensions         4.9.0                hd8ed1ab_0    conda-forge
typing_extensions         4.9.0              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023d                h0c530f3_0    conda-forge
uc-micro-py               1.0.1              pyhd8ed1ab_0    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   1.26.16                  pypi_0    pypi
wcwidth                   0.2.12             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.7.0              pyhd8ed1ab_0    conda-forge
websockets                10.4                     pypi_0    pypi
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xyzservices               2023.10.1          pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
y-py                      0.6.0                    pypi_0    pypi
yaml                      0.2.5                h7f98852_2    conda-forge
ypy-websocket             0.8.4                    pypi_0    pypi
zeromq                    4.3.5                h59595ed_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

Environment info

active environment : jl
    active env location : /home/joel/miniconda3/envs/jl
            shell level : 1
       user config file : /home/joel/.condarc
 populated config files : /home/joel/.condarc
          conda version : 23.3.1
    conda-build version : not installed
         python version : 3.9.16.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.35=0
                          __linux=6.5.6=0
                          __unix=0=0
       base environment : /home/joel/miniconda3  (writable)
      conda av data dir : /home/joel/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/joel/miniconda3/pkgs
                          /home/joel/.conda/pkgs
       envs directories : /home/joel/miniconda3/envs
                          /home/joel/.conda/envs
               platform : linux-64
             user-agent : conda/23.3.1 requests/2.28.2 CPython/3.9.16 Linux/6.5.6-76060506-generic pop/22.04 glibc/2.35 solver/libmamba conda-libmamba-solver/23.3.0 libmambapy/1.4.2
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
mfisher87 commented 9 months ago

:wave: Thanks for the report, Joel!

I don't have a ton of ideas why this might be happening! One thing I see that's different between my set up which does detect Jupyter and yours is that I have installed the jupyter metapackage, but it looks like you haven't. Can you try conda install -n jl jupyter and then quarto check again and see if it picks it up?

joelostblom commented 9 months ago

Thanks for the quick response! Hmm, I tried that but same result. I also tried creating a new env with conda create -n quarto pip quarto jupyter jupyterlab notebook but doing quarto check inside that environment gives the same results of a missing jupyter installation. Is there any ways to know exactly which executable name quarto is looking for (just jupyter or jupyterlab, notebook etc?); it seems like the log level is already on the most verbose setting by so I couldn't find a way for it to output what it is searching for and where

mfisher87 commented 9 months ago

Interesting, thanks for trying that.

Is there any ways to know exactly which executable name quarto is looking for (just jupyter or jupyterlab, notebook etc?)

Here's the source:

https://github.com/quarto-dev/quarto-cli/blob/27b29d91edb577c1bf4e3b2e7958be0239eddfaf/src/command/check/check.ts#L219

calls down to

https://github.com/quarto-dev/quarto-cli/blob/27b29d91edb577c1bf4e3b2e7958be0239eddfaf/src/core/jupyter/capabilities.ts#L203

calls down to

https://github.com/quarto-dev/quarto-cli/blob/27b29d91edb577c1bf4e3b2e7958be0239eddfaf/src/resources/capabilities/jupyter.py#L4

At the lowest level, looks like importlib is being used to discover the packages, and the python script is outputting YAML keys and values, which are being read by getJupyterCapabilities at the middle level. I think running just the Python capabilities/jupyter.py script may be enlightening.

I haven't taken the time to exercise any of this code, and may not have the time for the immediate future, as I'm a bit overwhelmed :upside_down_face: Any additional help sleuthing this would be greatly appreciated :)

Anyway, I don't know what is different about my pre-existing env, but when I create a new env I can also repro this.

New env

$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.58.3: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /home/robatt/.local/share/miniconda3/envs/test-jupyter-detect/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.1 (Conda)
      Path: /home/robatt/.local/share/miniconda3/envs/test-jupyter-detect/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

Pre-existing env

$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.58.3: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /home/robatt/.local/share/miniconda3/envs/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.0 (Conda)
      Path: /home/robatt/.local/share/miniconda3/envs/quarto/bin/python
      Jupyter: 5.3.2
      Kernels: python3

(/) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

:confounded:

mfisher87 commented 9 months ago

I was curious so I ran the capabilities script (using the installed version of the script, not the version from GitHub's main branch linked above). I gotta get going for some errands now though.

Pre-existing env (detects jupyter):

versionMajor: 3
versionMinor: 12
versionPatch: 0
versionStr: "3.12.0 | packaged by conda-forge | (main, Oct  3 2023, 08:43:22) [GCC 12.3.0]"
conda: true
execPrefix: "/home/robatt/.local/share/miniconda3/envs/quarto"
executable: "/home/robatt/.local/share/miniconda3/envs/quarto/bin/python"
jupyter_core: 5.3.2
nbformat: 5.9.2
nbclient: 0.8.0
ipykernel: 6.25.2
$ conda list -n quarto -e | grep jupyter_core
jupyter_core=5.3.2=py312h7900ff3_0

New environment (does not detect jupyter):

versionMajor: 3
versionMinor: 12
versionPatch: 1
versionStr: "3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:03:24) [GCC 12.3.0]"
conda: true
execPrefix: "/home/robatt/.local/share/miniconda3/envs/test-jupyter-detect"
executable: "/home/robatt/.local/share/miniconda3/envs/test-jupyter-detect/bin/python"
jupyter_core: null   # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Added for emphasis :)
nbformat: 5.9.2
nbclient: 0.8.0
ipykernel: 6.28.0
$ conda list -e | grep jupyter_core
jupyter_core=5.6.0=py312h7900ff3_0
mfisher87 commented 9 months ago

I ran the capabilities/jupyter.py script from quarto-cli's main branch on the env in which quarto does not detect Jupyter, and it appears that the detection issue is resolved on the main branch:

versionMajor: 3
versionMinor: 12
versionPatch: 1
versionStr: "3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:03:24) [GCC 12.3.0]"
conda: true
execPrefix: "/home/robatt/.local/share/miniconda3/envs/test-jupyter-detect"
executable: "/home/robatt/.local/share/miniconda3/envs/test-jupyter-detect/bin/python"
jupyter_core: 5.6.0
nbformat: 5.9.2
nbclient: 0.8.0
ipykernel: 6.28.0

The difference between the two scripts is significant:

17a18
>   v = 'null'
19,20c20,25
<     imp = importlib.import_module(pkg)
<     sys.stdout.write(str(imp.__version__))
---
>     try:
>       from importlib.metadata import version
>       v = version(pkg)
>     except ImportError:
>       imp = importlib.import_module(pkg)
>       v = str(imp.__version__)
22c27,28
<     sys.stdout.write('null')
---
>     pass
>   sys.stdout.write(v)
28,29c34
< 
< 
---
> discover_package('shiny')
mfisher87 commented 9 months ago

I found the root cause, jupyter_core 3.6.x removes __version__ from its API. Downgrading jupyter_core or upgrading to Quarto 1.4 will resolve this issue.

https://github.com/quarto-dev/quarto-cli/pull/7974#issue-2049117022

@cderv @cscheid do you think this fix can be backported to Quarto 1.3.x?

joelostblom commented 9 months ago

Super, thank you so much for all the help here @mfisher87 ! Knowing that you can reproduce it and that it is an issue with the version of jupyter_core is really helpful

cderv commented 9 months ago

This was reported in Quarto at

and solved in https://github.com/quarto-dev/quarto-cli/commit/ccfdc52daeae74c66e4d6715ef5bbbcf2ccac05f if you want the exact diff

We did not backport though - v1.4 is for very soon. But we can maybe consider... 🤔

mfisher87 commented 9 months ago

v1.4 is for very soon

:star_struck: :heart:

But we can maybe consider...

I don't think that work will be needed anymore to fix 1.3.x :partying_face:

The jupyter_core team has acknowledged this change was a mistake and will be fixed, so 1.3 should resume working as expected after that fix is released. https://github.com/jupyter/jupyter_core/issues/384#issuecomment-1872149738

cderv commented 9 months ago

Issue is fixed it seems

All good for 1.3 it seems.

Should we close this then ?

cscheid commented 9 months ago

Yup, jupyter_core 5.6.1 has the fix.

mfisher87 commented 9 months ago

Thanks all :)