I am trying to use Quarto
to render the following known example file (ex2_Julia.qmd
):
---
title: "Plots Demo"
author: "Norah Jones"
date: "5/22/2021"
format:
html:
code-fold: true
jupyter: julia-1.8.0
---
## Parametric Plots
Plot function pair (x(u), y(u)).
See @fig-parametric for an example.
```{julia}
#| label: fig-parametric
#| fig-cap: "Parametric Plots"
using Plots
plot(sin,
x->sin(2x),
0,
2π,
leg=false,
fill=(0,:lavender))
I have no problems when using the Python version, but when I do the following command on the terminal (Mac), I get an error:
❯ quarto render ex2_julia.qmd
ERROR: Jupyter kernel 'julia-1.8.0' not found.
I don’t understand why the kernel is not found. I added IJulia
.
1 Like
mkitti
August 23, 2022, 3:54pm
2
What is the output of jupyter kernelspec list
?
When you installed IJulia did you modify ENV["PYTHON"]
to work in the same Python environment as Quarto?
See GitHub - JuliaPy/PyCall.jl: Package to call Python functions from the Julia language
You’re right:
Available kernels:
ir /Users/sergiobacelar/Library/Jupyter/kernels/ir
julia-1.6 /Users/sergiobacelar/Library/Jupyter/kernels/julia-1.6
julia-1.7 /Users/sergiobacelar/Library/Jupyter/kernels/julia-1.7
python3 /Users/sergiobacelar/Library/Jupyter/kernels/python3
octave /Users/sergiobacelar/anaconda3/share/jupyter/kernels/octave
There is no julia-1.8.0
kernel. How can I modify the ENV
? I am using Anaconda and I have a base
env. I tried conda deactivate
but I think it didn’t work.
In Julia REPL (plz make sure you are running Julia 1.8)
using Pkg
Pkg.build("IJulia")
This command should register the julia-1.8
kernel.
Just to be sure, you can run jupyter kernelspec list
to see if julia-1.8
kernel is installed.
Edit: And as @mkitti suggested, please make sure IJulia is using the same python environment as quarto is.
4 Likes
mkitti
August 23, 2022, 4:07pm
8
Try this in julia.
ENV["PYTHON"] = "/path/to/python/used/by/quarto"
using Pkg
pkg"add PyCall"
pkg"build PyCall"
pkg"add IJulia"
pkg"build IJulia"
You can determine the path to quarto’s Python using which python
.
4 Likes
I think I found the solution:
build IJulia
3 Likes
DrPapa
August 24, 2022, 12:59pm
10
I see that build
fixed your issue, but I wanted to put this here in case somebody else has a slightly different issue. I had a weird case were Quarto was picking up a different python version than what was on my path without me knowing. It was using some random conda env version. In that case build
didn’t work b/c it wasn’t registering with the correct Jupyter install.
In that case , I was able to debug things using quarto check
3 Likes
visr
August 25, 2022, 8:36am
11
This looks like it changed recently:
Use IJulia’s built-in conda environment / jupyter install for julia notebooks/qmds
https://github.com/quarto-dev/quarto-cli/blob/v1.1.120/news/changelog-1.1.md?plain=1#L10
In older versions I had to set QUARTO_PYTHON
to my IJulia conda c:\Users\username\.julia\conda\3\python.exe
, since I don’t have python
in my path.
jhchou
September 2, 2022, 9:41am
12
Thank you SO much for this suggestion. I’m in Python environment hell, and your suggestion showed that for whatever reason, Quarto
couldn’t find my Jupyter
installation.
Hugo
January 12, 2023, 10:00pm
13
Where do I run this command?
Hugo
January 12, 2023, 10:04pm
14
Any recommendations in case the accepted solution does not work? Quarto was working fine for me, but I just updated to a newer version of Julia (1.8.5), and maybe this has “broken” something.
This seems to be an issue with Julia > 1.8.3 and it has been reported in the quarto-cli repository:
opened 07:44PM - 21 Sep 22 UTC
closed 08:13PM - 07 Feb 23 UTC
bug
### Bug description
Hi, I am hitting this error, trying to render a .qmd file, … using Quarto in PowerShell (same with VSCode) on Windows 10. I can use the julia-1.7 kernel in jupyter lab, no probs. And I can render a .qmd using the python3 kernel in quarto
```
Starting julia-1.7 kernel...Traceback (most recent call last):
File "C:\Program Files\Quarto\share\jupyter\jupyter.py", line 21, in <module>
from notebook import notebook_execute, RestartKernel
File "C:\Program Files\Quarto\share\jupyter\notebook.py", line 17, in <module>
from nbclient import NotebookClient
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\nbclient\__init__.py", line 6, in <module>
from .client import NotebookClient, execute # noqa: F401
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\nbclient\client.py", line 14, in <module>
from jupyter_client import KernelManager
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\jupyter_client\__init__.py", line 6, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\jupyter_client\channels.py", line 12, in <module>
import zmq.asyncio
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\zmq\__init__.py", line 103, in <module>
from zmq import backend
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\zmq\backend\__init__.py", line 31, in <module>
raise original_error from None
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\zmq\backend\__init__.py", line 26, in <module>
_ns = select_backend(first)
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\zmq\backend\select.py", line 31, in select_backend
mod = import_module(name)
File "C:\Users\arn203\.julia\conda\3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\arn203\.julia\conda\3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (
ImportError: DLL load failed while importing _device: The specified module could not be found.
```
I'm pretty lost with this at this point! Any help would be much appreciated.
### Checklist
- [ ] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [ ] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
latest activity there 10h ago, so I guess it’s actively worked on.
Basically, if you install and build IJulia
with julia version > 1.8.3, it will not work (I tested only with 1.8.5). I removed IJulia
and re-installed and rebuilt it using 1.8.3 and it worked.