You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to publish a site via GitHub Actions. I can render successfully on my machine using quarto cli (quarto render . and quarto publish, and when I do not include any pages with jupyter: python3 specified in the yaml header, my action works. However, when it hits a page with
---
jupyter: python3
---
in the front matter yaml it fails with:
[10/12] pages/01-reproducible-science-tools/open-reproducible-science/03-best-practices.qmd
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>
import nbformat
ModuleNotFoundError: No module named 'nbformat'
Python 3 installation:
Version: 3.10.12
Path: /usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
There is a environment.yml file in this directory. Is this for a conda env that you need to restore?
Using shell: bash -el {0} I have found is necessary to get the conda activation to stick for regular shell commands. And I have checked that the environment is activated and available as a kernel to shell commands with the following:
Run jupyter kernelspec list
Available kernels:
python3 /usr/share/miniconda/envs/learning-portal/share/jupyter/kernels/python3
However, you will notice in the error above that the quarto-actions render action is using /opt/quarto/share/jupyter/jupyter.py as jupyter, and not the version from my environment.
The text was updated successfully, but these errors were encountered:
Thanks a lot for the report. I believe we need some adjustment for Conda environment, as we have done for virtualenv to make sure the activated env works.
As a workaround, I am thinking that if you set QUARTO_PYTHON environment variable in CI jobs to the python version from your learning-portal, Quarto CLI should not do any Python auto-detection and use the right version...
Unless this is an issue only for kernel detection where first occurrence of python3 kernel found is used. 🤔
Anyhow, I am thinking we should detect CONDA_DEFAULT_ENV and if this is set, use that. Can you confirm this env var is set only when you activate a conda environment ?
I am trying to publish a site via GitHub Actions. I can render successfully on my machine using quarto cli (
quarto render .
andquarto publish
, and when I do not include any pages withjupyter: python3
specified in the yaml header, my action works. However, when it hits a page within the front matter yaml it fails with:
I installed and activated my conda environment (which include nbformat, whole environment definition here: https://github.com/cu-esiil-edu/esiil-learning-portal/blob/main/environment.yml) with the following action yaml:
Using
shell: bash -el {0}
I have found is necessary to get the conda activation to stick for regular shell commands. And I have checked that the environment is activated and available as a kernel to shell commands with the following:However, you will notice in the error above that the quarto-actions render action is using
/opt/quarto/share/jupyter/jupyter.py
as jupyter, and not the version from my environment.The text was updated successfully, but these errors were encountered: