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

Issue with reticulate::py_module_available("rdkit") returning TRUE in RStudio Console but FALSE in Shiny Serve

programmeradmin0浏览0评论

I'm encountering strange behavior using the reticulate package in R. When I run the following in the RStudio console:

reticulate::py_module_available("rdkit")

It returns TRUE, but when I include the same code at the top of my server.R in a Shiny app, run the app, it prints FALSE.

However, if I first run reticulate::py_module_available("rdkit") in the R console and then start the Shiny app, the code inside Shiny prints TRUE as expected. But if I start a fresh Shiny session, it prints FALSE.

Interestingly, for other modules like matplotlib, I don’t see this issue: both in the console and inside the Shiny app, reticulate::py_module_available("matplotlib") returns TRUE.

I also verified that both libraries (rdkit and matplotlib) are located in the same directory by running:

pip3.12 show rdkit
pip3.12 show matplotlib

Has anyone encountered this issue or know why rdkit behaves differently in a Shiny app compared to the R console?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论