5

I have had a lot of trouble trying to install RDKit using python3 and Ubuntu 20.04 LTS Tried to install rdkit this way:

sudo apt-get install python3-rdkit

But then when I try to import it using python3 it doesn't work. It installed indeed, but it is not in the package-list. Neither I can import it after using for example:

from rdkit import Chem

The official web (https://www.rdkit.org/docs/Install.html) site does have the following installation sentence, but it didn't work:

sudo apt-get install python-rdkit librdkit1 rdkit-data

I will appreciate any help!

SEBASTIAN
  • 75
  • 1
  • 8

3 Answers3

3

After you've created and activated your conda environment, run:

conda install -c conda-forge rdkit

Ref: https://anaconda.org/conda-forge/rdkit

Brndn
  • 676
  • 1
  • 7
  • 21
0

I'm not sure rdkit is actually compatible with python 3.8 yet. For example there are no python 3.8 build on conda channel.

beginner_
  • 7,230
  • 18
  • 70
  • 127
0

When apt installs python3-rdkit it puts the packages in /usr/lib/python3/dist-packages/rdkit, which Python doesn't seem to pick up. I symlinked that folder to the site-packages folder with:

cd /usr/local/lib/python3.9/site-packages/
ln -s /usr/lib/python3/dist-packages/rdkit .

and then I could import rdkit in python.

Note: running apt show python3-rdkit shows that the package is currently for Python 3.9

artran
  • 310
  • 2
  • 10