0

I need to install a version of the rdkit library released prior to 2019, when support for Python 2 was removed. This is needed to work with this library: https://github.com/brain-research/deep-molecular-massspec

I have downloaded the library from the git page, eg. https://github.com/rdkit/rdkit/releases/tag/Release_2018_09_1, and tried using pip to install from that.

sudo pip install rdkit-Release_2018_09_1b1.tar.gz

I get the following error:

Processing ./rdkit-Release_2018_09_1b1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in IOError: [Errno 2] No such file or directory: '/tmp/pip-ohIcaj-build/setup.py'

---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-ohIcaj-build

I have tried installing the specific version using pip too:

sudo pip install rdkit==2018.09.01

Which gives:

Collecting rdkit==2018.09.01 Could not find a version that satisfies the requirement rdkit==2018.09.01 (from versions: ) No matching distribution found for rdkit==2018.09.01

Can someone tell me how to do this?

Ninja Chris
  • 324
  • 1
  • 3
  • 12

4 Answers4

4

@paisanco is correct, attempting to install rdkit with pip will not work. The easiest way to install rdkit is by using Anaconda unless you want to build from source.

If you have Anaconda installed you can create a python 2.7 virtual environment:

conda create --name test-env python=2.7

You can then activate it:

conda activate test-env

And then install the rdkit version you require:

conda install -c rdkit rdkit=2018.09.1

Using Python:

import rdkit
print rdkit.__version__
[Out]: '2018.09.1'
Oliver Scott
  • 1,673
  • 8
  • 17
1

Create a new conda environment with python 2.7.15:

conda create -n py27_rdkit python=2.7.15 ipython

Activate environment (python2.7)

conda activate py27_rdkit

Now in the py27_protac environment, install older version of rdkit that won't gripe about python2.7:

conda install -c conda-forge rdkit rdkit=2018.09.1

The conda install command in answer above: 'conda install -c rdkit rdkit=2018.09.1' failed due numerous conflicts.

xspensiv
  • 11
  • 2
0

The problem is what you downloaded, according to that site, is a tar archive containing the source code for that library, not a pip package.

So attempting to install it using pip will not work.

The RDKit project home page gives other options for installing 1) from within an Anaconda conda virtual environment 2) from the source code (what you downloaded) for Windows, Linux, and Mac.

Those instructions are at RDKit installation instructions

paisanco
  • 4,098
  • 6
  • 27
  • 33
  • Thank you for your answer. Those instructions don't describe how to install a specific version of the rdkit library, which is what I have asked for help to achieve. – Ninja Chris Aug 17 '19 at 22:29
  • Your best bet would be to download the source code for the specific version you need from their github and follow the instructions for building from source for the platform you are running on. I can't tell for sure but their documentation suggests they maintain a conda environment only for a specific version. So again building from source is likely the way to go. – paisanco Aug 17 '19 at 22:34
  • While older versions are not actively maintained you can download any [rdkit version back to 2014](https://anaconda.org/rdkit/rdkit/files) – Oliver Scott Aug 19 '19 at 14:44
-1
conda create -n my_env python=3.7
conda activate my_env
conda install numpy matplotlib 
conda install cmake cairo pillow eigen pkg-config
conda install boost-cpp boost py-boost

and download rdkit package https://anaconda.org/rdkit/rdkit/files

# finally
conda install rdkit-2020.09.1b1.0-py37hd50e099_1.tar.bz2 
sailfish009
  • 2,561
  • 1
  • 24
  • 31