Access to rdkit

Everything was working perfectly. I installed "reticulate" package and lost access to "rdkit" package. Below is the code and error messages.

I have installed R vesion 3.5.0, RStudio version 1.1.463, Python version 3.7.2, and anaconda 2018.12.

Will very much appreciate help in getting access to "rdkit" in RStudio.
Many thanks.

Here is the code and error messages.
library(reticulate)
rdk <- import("rdkit")
Error in py_module_import(module, convert = convert) :
ModuleNotFoundError: No module named 'rdkit'

install.packages("rdkit")
Installing package into ‘C:/Users/vijay.gombar/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rdkit’ is not available (for R version 3.5.0)

You can't install a python library with install.packages() from R, you have to install it on the same python environment you are using for reticulate

Thank you very much, andresrcs. If I understand correctly, I cannot use install.packages("rdkit") in RStudio. But I installed "reticulate" in R as: install.packages("reticulate").
I am afraid I don't quite understand how to follow your suggestion. Would you be kind enough to spell the command(s) I need to execute either at the conda prompt or python prompt which will allow the command cdk <- import("rdkit") to run successfully.
Best regards,
Vijay

This article explains how to install python packages from R using reticulate

Thank you.

I will give it a go.
Best regards,
Vijay

Super!

Thank you very much andresrcs! The article you mentioned did help. I made these changes:

py_install("scipy")
py_install("rdkit")

library(reticulate)
rdk <- import("rdkit").

The last statement loads rdkit with warning "In py_initialize(config$python, config$libpython, config$pythonhome, :
'.Random.seed[1]' is not a valid integer, so ignored.

But rdkit works OK.

Again, thank you for pointing me to the right place.

Best regards,
Vijay

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.