Install rdkit to CentOS7

I use OSX or unbuntu for coding usually.
But, some case CentOS is needed to make some services.
So, I checked the way to install rdkit to centos7.
I used docker for my test, because docker can make virtual environment in my mac book.
First I pull the Cent OS ver7.

iwatobipen$ docker pull centos:7

Then run the image.

iwatobipen$ docker run -it centos:7

OK I can log in centos7. 😉
Next, I installed pyenv for install anaconda.
I used dnf instead of yum. So, I installed dnf using yum.
Command is following.

[root@1db835ac61b4 ~]# mkdir rdkittest & cd rdkittest
[root@1db835ac61b4 rdkittest]# yum install epel-release
[root@1db835ac61b4 rdkittest]# yum install dnf

OK dnf is installed.
But I couldn’t update dnf, so I referred following url and updated dnf.

[root@1db835ac61b4 rdkittest]# rm -rf /etc/yum.repos.d/epel*
[root@1db835ac61b4 rdkittest]# dnf clear all
[root@1db835ac61b4 rdkittest]# dnf install epel-release
[root@1db835ac61b4 rdkittest]# dnf upgrade

Next, Install pyenv.

[root@1db835ac61b4 rdkittest]# dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
[root@1db835ac61b4 rdkittest]# git clone ~/.pyenv
[root@1db835ac61b4 rdkittest]# echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
[root@1db835ac61b4 rdkittest]# echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
[root@1db835ac61b4 rdkittest]# echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

Done! I just installed pyenv. So install anaconda ASAP. 😉
And install rdkit!

[root@1db835ac61b4 rdkit]# pyenv install anaconda3-4.1.0
[root@1db835ac61b4 rdkit]# pyenv local anaconda3-4.1.0
[root@1db835ac61b4 rdkit]# conda install -c rdkit rdkit=2016.03.4

Finished! Now I got rdkit in CentOS7.
Check it.

[root@1db835ac61b4 rdkittest]# ipython
Python 3.5.1 |Anaconda 4.1.0 (64-bit)| (default, Jun 15 2016, 15:32:45)
Type "copyright", "credits" or "license" for more information.

IPython 4.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from rdkit import Chem

In [2]: from rdkit import rdBase

In [3]: rdBase.rdkitVersion
Out[3]: '2016.03.4'

Works fine.

Anaconda is very useful tool for every one I think!

BTW why I install dnf ?

The answer is yum can handle only python2, but dnf can handle python3.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s