Hello,
I have built openbabel on Snow Leopard and am now trying to build the python 
bindings.  After I build and installed openbabel, I cd'd to the scripts/python 
directory and ran python setup.py build.  setup.py failed because it tries to 
copy openbabel.py onto itself with this line:

shutil.copyfile(os.path.join(srcdir, "openbabel.py"), "openbabel.py")

I then tried to fix this error by changing that part of setup.py:

    try:                                                                        
                           
        shutil.copyfile(os.path.join(srcdir, "pybel_py%dx.py" % 
sys.version_info[0]), "pybel.py")          
        shutil.copyfile(os.path.join(srcdir, "openbabel.py"), "openbabel.py")   
                           
    except shutil.Error:                                                        
                           
        pass  

It then fails because it can't find an openbabel header.  I tried to fix this 
by changing the definition of obExtention from:

obExtension = Extension('_openbabel',                                           
                           
                 [os.path.join(srcdir, "openbabel-python.cpp")],                
                           
                 include_dirs=[os.path.join(srcdir, "..", "..", "include"),     
                           
                               os.path.join("..", "include")],                  
                           
                 library_dirs=[os.path.join("..", "lib")],                      
                           
                 libraries=['openbabel']                                        
                           
                 )   

to:

obExtension = Extension('_openbabel',                                           
                           
                 [os.path.join(srcdir, "openbabel-python.cpp")],                
                           
                 include_dirs=[os.path.join(srcdir, "..", "..", "build", 
"include"),                       
                               os.path.join("..", "..", "include")],            
                           
                 library_dirs=[os.path.join("..", "..", "lib")],                
                           
                 libraries=['openbabel']                                        
                           
                 ) 

The build and install seemed to work at this point, but when I'm in a python 
prompt I get this error:

>>> import openbabel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cswank/src/opv/lib/python2.6/site-packages/openbabel.py", line 
56, in <module>
    _openbabel = swig_import_helper()
  File "/Users/cswank/src/opv/lib/python2.6/site-packages/openbabel.py", line 
52, in swig_import_helper
    _mod = imp.load_module('_openbabel', fp, pathname, description)
ImportError: 
dlopen(/Users/cswank/src/opv/lib/python2.6/site-packages/_openbabel.so, 2): 
Symbol not found: __ZTVN9OpenBabel20OBRMSDConformerScoreE
  Referenced from: 
/Users/cswank/src/opv/lib/python2.6/site-packages/_openbabel.so
  Expected in: flat namespace
 in /Users/cswank/src/opv/lib/python2.6/site-packages/_openbabel.so


I tried setting the LD_LIBRARY_PATH like the install instructions suggest, but 
it makes no difference.

Does anyone know what I'm doing wrong?

Thanks,

Craig
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
OpenBabel-scripting mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-scripting

Reply via email to