提问人:quickreaction 提问时间:10/13/2023 更新时间:10/13/2023 访问量:71
Windows 10:rstudio reticulate keras tensorflow :: anaconda vs. miniconda vs. python
Windows 10: rstudio reticulate keras tensorflow :: anaconda vs. miniconda vs. python
问:
我在 R/Rstudio 下运行的稳定 python 环境遇到的问题数量是压倒性的......而且安装步骤的排列过于灵活,无法激发任何方法的信心。
首先,我曾经.我擦除了电脑上任何蟒蛇的痕迹。我已经更新了所有软件包,并重新安装了.我有(也许我应该有,但我不明白为什么当大多数 R [Python 上下文] 文档使用 conda 管理时我不使用 conda......所以作为 R 上下文中 python 的新用户,我希望文档适用于我的工作),......然后我安装了最新的软件包并尝试,但出现错误(疯狂的是互联网上没有关于这个错误的任何内容)。尝试从新安装的软件包运行时也遇到错误。reticulate
uninstall_miniconda
reticulate
reticulate
install_miniconda
reticulate
install_python()
tensorflow
install_tensorflow()
mapply()
mapply()
install_keras()
keras
此外,几乎所有的网状文档都提到使用“r-reticulate”conda 环境......这再次表明安装 Miniconda 或 Anaconda 会更可取。
在尝试了不同的方法来激活 conda 环境,或者先安装 tensorflow,或者先安装 keras,或者最后激活 conda 环境之后......等等等等......除了在 Github 上提交问题外,我别无他法。因此,在尝试报告此问题时,预填充文本会说使用以下方法:
install.packages("remotes")
remotes::install_github(sprintf("rstudio/%s", c("reticulate", "tensorflow", "keras")))
if (is.null(reticulate::virtualenv_starter()))
reticulate::install_python()
keras::install_keras()
为什么 posit/rstudio 建议使用 而不是 ?
为什么在没有进一步干预(如定义环境变量或运行函数)的情况下终于工作了,但运行后一切都失败了?install_python()
install_miniconda()
install_keras()
install_python()
RETICULATE_PYTHON
use_python(my_python_directory)
install_miniconda()
我只是在寻找一些解释,希望它能促进我在 R 中使用 python,并希望网状结构能够以可预测的方式运行,或者我能够解决未来的问题,而不会觉得自己在寻宝游戏。
这是我的,以防万一:sessionInfo()
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.2 cli_3.6.1 tools_4.1.2 rstudioapi_0.15.0 rlang_1.1.1
答: 暂无答案
评论