RDKit fails to import Chem module on Mac OSX - Version #1175

Open
leelasd opened this Issue Nov 16, 2016 · 3 comments

Projects

None yet

2 participants

@leelasd
leelasd commented Nov 16, 2016 edited

In RDKit version:2016.03.4 and np111py27_1

I tried to import Chem from rdkit. It crashed and gave me the error below. Older version 2016.03.3 was working fine.

Any ideas why this is happening ? It works fine on Linux machine.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-17d7acb427ab> in <module>()
----> 1 from rdkit import Chem

/Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem/__init__.py in <module>()
     21 from rdkit import DataStructs
     22 from rdkit.Geometry import rdGeometry
---> 23 from rdkit.Chem import PeriodicTable as pyPeriodicTable
     24 from rdkit.Chem import rdchem
     25 _HasSubstructMatchStr=rdchem._HasSubstructMatchStr

ImportError: cannot import name PeriodicTable
@greglandrum
Member

That is an unusual one.
Can you please look in '/Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem' to see if there is a PeriodicTable.py in it?

@leelasd
leelasd commented Nov 17, 2016 edited

Yes it is there !! Dont know why this happened. Now I get a different error. It looks like this. This is happening only with MacOSX. Linux works perfectly

In [1]: import rdkit

In [2]: from rdkit import Chem
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-17d7acb427ab> in <module>()
----> 1 from rdkit import Chem

/Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem/__init__.py in <module>()
     27 from rdkit.Chem.rdmolfiles import *
     28 from rdkit.Chem.rdmolops import *
---> 29 from rdkit.Chem.inchi import *
     30 
     31 def QuickSmartsMatch(smi,sma,unique=True,display=False):

/Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem/inchi.py in <module>()
     35 import logging
     36 
---> 37 from rdkit.Chem import rdinchi
     38 from rdkit import RDLogger
     39 logger = RDLogger.logger()

ImportError: dlopen(/Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem/rdinchi.so, 2): Library not loaded: @rpath/libInchi.1.dylib
  Referenced from: /Users/Sriram/anaconda/lib/python2.7/site-packages/rdkit/Chem/rdinchi.so
  Reason: Incompatible library version: rdinchi.so requires version 1.0.0 or later, but libInchi.1.dylib provides version 0.0.0
@greglandrum
Member

Do you have either DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH set?

It's probably easiest if you just post the output you get when you type "export" in the terminal from which you launch Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment