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

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

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745095578a4610957.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信