rdkit: Problem installating rdkit ModuleNotFoundError: No module named 'rdkit'

I installed rdkit in my Ubuntu using the following command

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

Looking at the output it seems like everything went well

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libbonobo2-0 libbonobo2-common libgconf2-4 libgnome2-0 libgnome2-bin
  libgnome2-common libidl-common libidl0 liborbit-2-0 liborbit2
  linux-headers-3.13.0-119 linux-headers-3.13.0-119-generic
  linux-headers-3.13.0-139 linux-headers-3.13.0-139-generic
  linux-headers-3.13.0-52 linux-headers-3.13.0-52-generic
  linux-headers-3.13.0-77 linux-headers-3.13.0-77-generic
  linux-headers-3.13.0-79 linux-headers-3.13.0-79-generic
  linux-headers-3.13.0-83 linux-headers-3.13.0-83-generic
  linux-headers-3.13.0-85 linux-headers-3.13.0-85-generic
  linux-headers-3.13.0-87 linux-headers-3.13.0-87-generic
  linux-headers-3.13.0-93 linux-headers-3.13.0-93-generic
  linux-headers-3.13.0-95 linux-headers-3.13.0-95-generic
  linux-image-3.13.0-119-generic linux-image-3.13.0-139-generic
  linux-image-3.13.0-52-generic linux-image-3.13.0-77-generic
  linux-image-3.13.0-79-generic linux-image-3.13.0-83-generic
  linux-image-3.13.0-85-generic linux-image-3.13.0-87-generic
  linux-image-3.13.0-93-generic linux-image-3.13.0-95-generic
  linux-image-extra-3.13.0-119-generic linux-image-extra-3.13.0-139-generic
  linux-image-extra-3.13.0-52-generic linux-image-extra-3.13.0-77-generic
  linux-image-extra-3.13.0-79-generic linux-image-extra-3.13.0-83-generic
  linux-image-extra-3.13.0-85-generic linux-image-extra-3.13.0-87-generic
  linux-image-extra-3.13.0-93-generic linux-image-extra-3.13.0-95-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libboost-regex1.54.0
Suggested packages:
  rdkit-doc
The following NEW packages will be installed:
  libboost-regex1.54.0 librdkit1 python-rdkit rdkit-data
0 upgraded, 4 newly installed, 0 to remove and 260 not upgraded.
Need to get 8 054 kB of archives.
After this operation, 25,7 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://se.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-regex1.54.0 amd64 1.54.0-4ubuntu3.1 [261 kB]
Get:2 http://se.archive.ubuntu.com/ubuntu/ trusty/universe librdkit1 amd64 201309-1 [1 420 kB]
Get:3 http://se.archive.ubuntu.com/ubuntu/ trusty/universe python-rdkit amd64 201309-1 [1 897 kB]
Get:4 http://se.archive.ubuntu.com/ubuntu/ trusty/universe rdkit-data all 201309-1 [4 476 kB]
Fetched 8 054 kB in 0s (12,0 MB/s)                                             
Selecting previously unselected package libboost-regex1.54.0:amd64.
(Reading database ... 715051 files and directories currently installed.)
Preparing to unpack .../libboost-regex1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-regex1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package librdkit1.
Preparing to unpack .../librdkit1_201309-1_amd64.deb ...
Unpacking librdkit1 (201309-1) ...
Selecting previously unselected package rdkit-data.
Preparing to unpack .../rdkit-data_201309-1_all.deb ...
Unpacking rdkit-data (201309-1) ...
Selecting previously unselected package python-rdkit.
Preparing to unpack .../python-rdkit_201309-1_amd64.deb ...
Unpacking python-rdkit (201309-1) ...
Setting up libboost-regex1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up librdkit1 (201309-1) ...
Setting up rdkit-data (201309-1) ...
Setting up python-rdkit (201309-1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.14) ...

However when importing rdkit in Pythin I am getting the following error

>>> from rdkit import Chem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'rdkit'

Any help?

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

try this instead, maybe

import rdkit
from rdkit import Chem

@UnixJunkie I have started using Anaconda3 and everything can be installed properly now. Thanks for answering my question though.