-
Notifications
You must be signed in to change notification settings - Fork 923
ModuleNotFoundError: No module named 'rdkit.Contrib' #2279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Dean,
I think rdkit can not load Contrib directly, so I should append the path to
sys.path.
Example is below.
from rdkit import Chem
from rdkit.Chem import RDConfig
import os
import sys
sys.path.append(os.path.join(RDConfig.RDContribDir, 'SA_Score'))
# now you can import sascore!
import sascorer
mol = Chem.MolFromSmiles('NC(=O)c1ccccc1')
s = sascorer.calculateScore(mol)
s
Out[12]: 1.1592175456870955
I will be happy if the code will help you.
Kind regards,
Taka
2019年2月17日(日) 4:39 Dean Lewis Sayre Jr. <[email protected]>:
… *Description:*
I installed rdkit using conda and can activate my environment just fine.
- RDKit Version: 2018.09.1
- Platform: MacOS
I am attempting to run already existing code that makes use of the contrib
module, however, the import below won't work for me. I get the following
error:
ModuleNotFoundError: No module named 'rdkit.Contrib'
import rdkit
from rdkit.Contrib.SA_Score.sascorer import calculateScore
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2279>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBrY_ky8exobzfONXQpNhlZQAOssEIuks5vOF6OgaJpZM4a_J5t>
.
|
@iwatobipen worked like a charm! I am curious about something though. Why can't one directly import Contrib ('from rdkit import Contrib') as Chem is imported ('from rdkit import Chem')? |
That sounds good! Thank you for your prompt reply.
From readme of rdkit, Contrib folder with useful community-contributed
software harnessing the power of the RDKit.
So I think the folder is just contribution of rdkit and not main class of
rdkit.
2019年2月17日(日) 9:29 Dean Lewis Sayre Jr. <[email protected]>:
… @iwatobipen <https://github.com/iwatobipen> worked like a charm! I am
curious about something though. Why can't one directly import Contrib
('from rdkit import Contrib') as Chem is imported ('from rdkit import
Chem')?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2279 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABBrY6DZNtT9xGN53deQCiNqNDHOYAvKks5vOKJ3gaJpZM4a_J5t>
.
|
@iwatobipen is completely right here. The contrib modules aren’t generally as well tested and aren’t “supported” per se, so they aren’t automatically made available on PYTHONPATH |
@iwatobipen @greglandrum, thank you both for your quick help, cheers! |
Description:
I installed rdkit using conda and can activate my environment just fine.
I am attempting to run already existing code that makes use of the contrib module, however, the import below won't work for me. I get the following error:
ModuleNotFoundError: No module named 'rdkit.Contrib'
The text was updated successfully, but these errors were encountered: