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条)