'Problems installing RDKit in python 3.8 Ubuntu 20.04 LTS
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!
Solution 1:[1]
After you've created and activated your conda environment, run:
conda install -c conda-forge rdkit
Solution 2:[2]
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.
Solution 3:[3]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brndn |
| Solution 2 | beginner_ |
| Solution 3 | artran |
