【发布时间】:2022-12-26 05:13:04
【问题描述】:
我正在尝试在 Visual Studio Code 中运行 R 代码,但出现以下错误
`
Fehler in dyn.load(file, DLLpath = DLLpath, ...) :
kann shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/vscDebugger/libs/vscDebugger.so' nicht laden:
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/vscDebugger/libs/vscDebugger.so, 0x0006): tried: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/vscDebugger/libs/vscDebugger.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
`
我不知道为什么错误消息的第一部分不是英语,即使英语是设置语言,但这不是问题所在。它只是说它无法加载对象vscDebugger.so。
同时弹出一个窗口,上面写着“请安装 R 包 vscDebugger”,它要求我打开 launch.json,如下所示
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "R-Debugger",
"name": "Launch R-Workspace",
"request": "launch",
"debugMode": "workspace",
"workingDirectory": "${workspaceFolder}"
},
{
"type": "R-Debugger",
"name": "Debug R-File",
"request": "launch",
"debugMode": "file",
"workingDirectory": "${workspaceFolder}",
"file": "${file}"
},
{
"type": "R-Debugger",
"name": "Debug R-Function",
"request": "launch",
"debugMode": "function",
"workingDirectory": "${workspaceFolder}",
"file": "${file}",
"mainFunction": "main",
"allowGlobalDebugging": false
},
{
"type": "R-Debugger",
"name": "Debug R-Package",
"request": "launch",
"debugMode": "workspace",
"workingDirectory": "${workspaceFolder}",
"includePackageScopes": true,
"loadPackages": [
"."
]
},
{
"type": "R-Debugger",
"request": "attach",
"name": "Attach to R process",
"splitOverwrittenOutput": true
}
]
}
在顶部它说版本是 0.2.0。但是如果我运行 packageVersion('vscDebugger') 它返回 0.4.7 作为当前版本。
所有这一切都是一团糟。为什么我必须在已经安装 vsc 调试器的情况下安装它,为什么会有版本冲突?此外,错误消息的最后部分说明了文件的不兼容架构。这是怎么回事?我安装错了吗?我使用的是 macOS 版本 12.6,我的 R 版本是 4.2.1
我已经尝试卸载与 R 相关的所有 visual studio 代码扩展,然后重新安装它们。
【问题讨论】:
-
如果您在这里没有得到答案,可能值得在项目的 GitHub 存储库上提出一个问题:github.com/ManuelHentschel/VSCode-R-Debugger/issues
标签: r debugging visual-studio-code vscode-debugger