Replies: 4 comments 7 replies
-
Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? The goal is to make it as easy as possible for us to recreate your problem so that we can fix it: please help us help you! Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you for getting back to me. Here are the results of quarto check: Quarto 1.6.39
[>] Checking environment information...
Quarto cache location: C:\Users\jrh25\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.6.39
Path: C:\Users\jrh25\AppData\Local\Programs\Quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\jrh25\AppData\Roaming\TinyTeX\bin\windows\
Version: 2023
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.12.8 (Conda)
Path: C:/Users/jrh25/miniforge3/envs/datasci-env/python.exe
Jupyter: 5.7.2
Kernels: ir, python3
[>] Checking Jupyter engine render....OK
[>] Checking R installation...........OK
Version: 4.1.3
Path: C:/Users/jrh25/miniforge3/envs/datasci-env/lib/R
LibPaths:
- C:/Users/jrh25/miniforge3/envs/datasci-env/Lib/R/library
knitr: 1.43
rmarkdown: 2.22
[>] Checking Knitr engine render......OK I also did some further digging and found a workable solution to one of my issues. I added a .Rprofile file to my working directory. .Rprofile: .libPaths(c("C:/Users/jrh25/miniforge3/envs/datasci-env/Lib/R/library"))
library(reticulate)
use_condaenv(condaenv="datasci-env", conda="C:/Users/jrh25/miniforge3/condabin/conda.bat", required=TRUE)
This should add the path to my conda environment's R libraries to R library paths, and also point reticulate to my conda python installation. I've tested this setup with the following qmd: ---
title: "Testing with knitr engine"
date: "2025-01-08"
categories: [news, code, analysis]
engine: knitr
---
```{r}
.libPaths()
```
```{r}
library(reticulate)
py_config()
getwd()
```
```{python}
import pandas as pd
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
arr
```
```{r}
arr <- py$arr
print(arr)
```
```{python}
r['arr']
r.arr
```
Checking .libPaths() gives me: > .libPaths()
[1] "C:/Users/jrh25/miniforge3/envs/datasci-env/Lib/R/library"
[2] "C:/Program Files/R/R-4.4.2/library" Checking py_config() for reticulate gives me: > py_config()
python: C:/Users/jrh25/miniforge3/envs/datasci-env/python.exe
libpython: C:/Users/jrh25/miniforge3/envs/datasci-env/python312.dll
pythonhome: C:/Users/jrh25/miniforge3/envs/datasci-env
version: 3.12.8 | packaged by conda-forge | (main, Dec 5 2024, 14:06:27) [MSC v.1942 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/jrh25/miniforge3/envs/datasci-env/Lib/site-packages/numpy
numpy_version: 1.26.4
sys: [builtin module]
NOTE: Python version was forced by use_python() function So far everything appears to run seamlessly locally, although I'm still having issues with the Quarto render / publish step in my GitHub actions workflow, where I'm getting the following error: [4/7] posts/1-08-2025/index.qmd
Error in library(reticulate) : there is no package called ‘reticulate’
Execution halted
Error in library(reticulate) : there is no package called ‘reticulate’
Execution halted
Problem with running R found at /usr/bin/Rscript to check environment configurations.
Please check your installation of R. |
Beta Was this translation helpful? Give feedback.
-
The render/fpublish error just appears to be an issue with environment setup in the Github actions workflow itself, so an easier workaround right now seems to be just running quarto render
quarto publish gh-pages In my terminal, which successfully builds and deploys my website. I'll get rid of the workflow for now; I'm satisfied with just being able to run R and Python cells in my code. |
Beta Was this translation helpful? Give feedback.
-
I tried adding verbose trace and running both R.home() and libPaths() in the same cell. Here is some relevant output I found: -- Searching for R binary --
Looking for 'Rscript' in QUARTO_R: undefined
Looking for 'Rscript' in R_HOME: undefined
Looking for 'Rscript' in PATH.
[execProcess] which Rscript
[execProcess] Success: false, code: 1
Quarto did no found Rscript and will try to use it directly. And quarto only seems to render .libPaths(). On a side note, it looks like my GitHub workflow is passing all steps now... I don't know the exact reason why but I'll keep my fingers crossed until it breaks again, and I'll try some more troubleshooting when that happens. |
Beta Was this translation helpful? Give feedback.
-
Description
I recently got started with using Quarto to make my personal blog, and I'm currently using miniforge/mamba to manage my environment. Specifically, I have an environment datasci-env where I have Python and R libraries installed from the conda-forge channel.
I'm running into an issue where my index.qmd file doesn't seem to recognize my conda environment, despite it being activated in my VSCode IDE. Running "quarto check knitr" in the terminal gives me the following output:
Which I interpret as Quarto recognizing my conda environment, but I see the following output when I try to load the "reticulate" library in index.qmd, and when I display libPaths():
As you can see, reticulate isn't being recognized due to it not being found in libPaths, and my conda environment isn't displayed among the paths shown by libPaths().
I also run into a similar issue in my GitHub actions workflow in the render and publish step, specifically when I include "engine: knitr" in the YAML of my index.qmd file, where it again doesn't include my conda environment in libPaths:
This is confusing, because it conflicts with what I saw from Quarto when I ran "quarto check knitr" in the terminal, where my conda environment is the sole libPath. What could be the issue here and how do I address it? Is it an issue with VSCode, the Quarto extension, or how I configured my qmd file? I've tried scouring the documentation but haven't found anything relating to this issue.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions