You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Positron中运行Quarto代码块时遇到的问题

Positron中Quarto运行R/Python代码块报错问题

在Positron中使用Quarto编写.qmd文档时,运行R或Python代码块遇到异常,执行quarto preview命令时两种语言代码块返回不同错误。

示例.qmd文件

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

## R Code

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

Python Code

print("Hello, Python!")
## 错误信息
- **R代码块错误**:
```r
Error in dir.exists(x) : file name conversion problem – name too long?
Calls: … lapply -> FUN -> dir_exists -> -> dir.exists
Execution halted
  • Python代码块错误:
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> 

已尝试的解决方法

  • 确认Python和R已正确安装并添加至系统PATH
  • 检查项目文件夹权限
  • 尝试缩短项目路径,但问题仍未解决

恳请各位提供帮助或建议!

R版本:4.4.2,Python版本:3.12.9


内容的提问来源于stack exchange,提问作者Erik De Luca

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 23:53:13