Closed joelostblom closed 10 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?
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
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:
calls down to
calls down to
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.
$ 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/
$ 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:
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.
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
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
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')
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?
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
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... 🤔
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
Issue is fixed it seems
All good for 1.3 it seems.
Should we close this then ?
Yup, jupyter_core 5.6.1 has the fix.
Thanks all :)
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:
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
Environment info