小编Bet*_*eth的帖子

无法安装 brms 或 rstan 进行编译

我一直试图让 brms/rstan 在我的系统上工作,但运气有限。我有 R 4.2 并且正在使用 R studio。我最初开始在 R 中这样做,因为我无法让任何贝叶斯包在 Python 中工作,而且我(这似乎是错误的)认为在 R 中设置会更容易。

我正在观看有关如何使用 brms 进行回归的视频(https://www.youtube.com/watch?v=-1Hob2qpyeY),因此安装了 brms 和 bayesplot。RStudio 告诉我安装 Rtools,所以我就这么做了。我能够运行 lm,但使用 brm 后我无法运行模型。我卸载了所有软件包并尝试排除故障,并遵循了几篇帮助文章,但没有成功。

我认为可能存在问题,因为 R 安装到 C:\Program Files 并且我没有写访问权限(不是管理员),所以我尝试使用https://www.accelebrate.com/更改默认库库/操作方法文章/r-rstudio-library

我尝试按照https://learnb4ss.github.io/learnB4SS/articles/install-brms.html 但“配置 C++”部分没有给出预期结果(https://github.com/stan-dev/rstan/ wiki/Configuring-C---Toolchain-for-Windows无法安装 json)

我重新安装了 RTools。我尝试查看这篇文章,但无法弄清楚我需要的第二个目录是什么https://github.com/metrumresearchgroup/mrgsolve/issues/160 “请注意,路径前面有两个目录。” sys.getenv 的输出是巨大的。我的 Rtools 是 C:\rtools40

Sys.getenv("PATH")
Run Code Online (Sandbox Code Playgroud)

1 “c:\rtools42\x86_64-w64-mingw32.static.posix\bin;c:\rtools42\usr\bin;C:\rtools42\usr\bin;C:\Program Files\R\R-4.2.0 \bin\x64;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C: \Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet;C:\Program Files (x86)\dotnet;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\ XXXXXXXX\AppData\Local\Programs\Python\Python310\Scripts;C:\Users\XXXXXXXX\AppData\Local\Programs\Python\Python310;C:\Users\XXXXXXXX\AppData\Local\Microsoft\WindowsApps;C:\Users \XXXXXXXX\AppData\Local\Programs\Microsoft VS Code\bin;C:\msys64\mingw64\bin;C:\Program Files\R\R-4.2.0"

环境变量的 图像 路径变量的图像

此时我尝试再次运行示例模型

example(stan_model, package = "rstan", run.dontrun …
Run Code Online (Sandbox Code Playgroud)

compiler-errors r stan rstan brms

4
推荐指数
1
解决办法
1867
查看次数

标签 统计

brms ×1

compiler-errors ×1

r ×1

rstan ×1

stan ×1