pythonpython-3.xwindowsinstallationrdkit

RDKit installation under Windows and Python3.7.4


RDKit could be a nice package if it wasn't so complicated to install. Here on SO, there are several questions having problems with the installation of RDKit. However, on different operating systems or different environments.

My configuration is: Win10, Python 3.7.4, pip is installed, PATH is set, PYTHONPATH is set. The installation of other modules is working fine via python -m pip install <package>.

I'm aware that the site recommends the fastest installation with Anaconda. However, I don't have and don't want Anaconda.

On the webpage it says: "Get the appropriate windows binary build from: https://github.com/rdkit/rdkit/releases". However, there are no binaries of the latest versions.

This means, I would have to build it from source. I'm hesitating because the process seems to be pretty complicated, many extra installations with new problems and unknowns, and furthermore, the instructions seem to be outdated and incomplete for somebody who would build binaries from the source for the first time.

So, then I tried some unofficial binaries of RDKit.

If I unpack them and set the paths according to instructions, I get this error message:

>>> from rdkit import Chem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\xyz\Programs\RDKit\rdkit\__init__.py", line 2, in <module>
    from .rdBase import rdkitVersion as __version__
ImportError: DLL load failed: The specified module could not be found.

So, finally my questions:

I'm pretty sure it is probably a "small" thing (a path here or a check there), but I'm stuck. Thank you for any hints.

Update:

Apparently, it is not just a "small" thing. Chances to get this to work are most likely very low. In the meantime I found this:

https://github.com/rdkit/rdkit/issues/1812

https://github.com/rdkit/rdkit/issues/2389

If the author of rdkit writes (April 2019):

I would be happy to be able to do pip distributions of the RDKit, but to the best of my knowledge no one has managed to figure out how to make it actually work.

I'd be happy to accept a PR from someone who has figured this out, but I am not likely to have the time to do this myself anytime in the near future.

So, if anybody feels capable achieving this, please feel free. I will invest time in something else or will have to switch to Anaconda if I want to use RDKit.


Solution

  • Just for closing this question...

    In the meantime, it seems installation of RDKit can be done without conda. At least, I succeeded with Python 3.7.4 and 3.11.1 (64 bit), but not with Python 3.6.3 (32 bit)

    pip install rdkit
    

    See updates on: https://github.com/rdkit/rdkit/issues/1812

    and the comment from @VandanRevanur in 2023 here: How to install a package rdkit from Conda with pip?