最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Issues Running Code Chunks in Quarto on Positron - Stack Overflow

programmeradmin1浏览0评论

Read more in GH discussion.

I’m encountering issues using Quarto within Positron when trying to include R or Python code chunks in my .qmd documents. When I run the quarto preview command, I receive different errors depending on the language of the chunk.

Example .qmd File:

---
title: "Test Document"
format: html
---

## R Code

```{r}
print("Hello, R!")
```

## Python Code

```{python}
print("Hello, Python!")
```

Errors Received:

  • R: I receive the following error when attempting to execute an R code chunk:
Error in dir.exists(x) : file name conversion problem – name too long?
Calls: … lapply -> FUN -> dir_exists -> -> dir.exists
Execution halted
  • Python: When running a Python code chunk, I encounter this error:
PS D:\GitHub\testing> quarto preview d:/GitHub/testing/test.qmd --no-browser --no-watch-inputs
ERROR: Impossible to access to the file. (os error 1920): stat 'C:\Users\erik4\AppData\Local\Microsoft\WindowsApps\python3.12.exe'

Stack trace:
    at Object.statSync (ext:deno_fs/30_fs.js:425:3)
    at existsSync (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:223:27)
    at getQuartoJupyterCapabilities (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:30667:13)
    at jupyterCapabilities (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:30582:34)
    at pythonExec (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:30764:24)
    at Object.execute (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:40546:35)
    at async renderExecute (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:78033:27)
    at async renderFileInternal (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:78201:43)
    at async renderFiles (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:78069:17)
    at async render (file:///C:/Users/erik4/AppData/Local/Programs/Positron/resources/app/quarto/bin/quarto.js:82929:21)
PS D:\GitHub\testing> 

What I've Tried:

  • Verified that both Python and R are installed correctly and are in the system PATH.
  • Checked project's folder permissions.
  • Tried reducing the project path length, but the issue persists.

Thank you in advance for any help or suggestions!

R version: 4.4.2, Python version: 3.12.9

发布评论

评论列表(0)

  1. 暂无评论