5

So, I am trying to add RDKit to my project in PyCharm. I have found that if you are using interpreter /usr/bin/python2.7 PyCharm will try to install stuff using the pip. While, RDKit requires conda. I have tried to change the interpreter to conda, but RDKit is either not on the list or it can't open the URL with the repo. Does anyone know how to fix that?

By the way, is it possible while keeping the interpreter /usr/bin/python2.7 to make it use anything else (not pip), while installing stuff?

2
  • Anna have you asked this on the RDKit mailing list? IMO you're more likely to get an answer there.
    – piman314
    Jan 20, 2016 at 11:45
  • @ncfirth thank you, will give it a try) Jan 20, 2016 at 12:07

2 Answers 2

5

I have finally found how to do that and it's not difficult at all:

  1. Install conda;
  2. Install RDKit, following these instructions
  3. Go to the preferences in PyCharm either like this:

enter image description here

or like this (you need a wrench):

enter image description here

  1. In the project interpreter select: ~/anaconda/envs/my-rdkit-env/bin/python

  2. Make sure you add or update the corresponding python paths to PATH, otherwise it wouldn't work.

TESTS:

  1. Tried to install fiona - success, so there's no impact on the installation;
  2. Tried the simple code: print('HELLO WORLD!') - worked
  3. Tried rdkit code

        from rdkit import Chem
    
    
        m = Chem.MolFromSmiles('Cc1ccccc1')
    
        print(m)
    

worked, the log: <rdkit.Chem.rdchem.Mol object at 0x101125080>

0

Another option is to select the existing virtual environment when you create a new project in PyCharm. Once you go through the steps that Anna laid out above, the "Previously configured interpreter" section of the "Create Project" screen should show the ~/anaconda/envs/my-rdkit-env/bin/python as an option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.