From: richard a. <ric...@ya...> - 2006-11-05 16:14:04
|
Hi Marin, Your suggestion worked perfectly. I changed the first few lines of openbabel.py to the following: import sys if sys.platform.find("linux") != -1: #import dl sys.setdlopenflags(sys.getdlopenflags() | 0x100) Doing this I can now import openbabel, create a working OBConversion, and do a simple smiles->inchi conversion. Many thanks! Rich --- Martin Vogt <mar...@bi...> wrote: > Hi, > > there is indeed a simple workaround for this > problem. > Note that the dl module is only needed for the > numerical constant > > dl.RTLD_GLOBAL > > This constant is defined from a system header > 'dlfcn.h', if i recall > correctly. Searching through your system headers you > might find that > this constant is equal to 0x100 (at least on my > system: Suse 10.1 64bit). > So you can replace the top lines with: > > if sys.platform.find("linux") != -1: > sys.setdlopenflags(sys.getdlopenflags() | 0x100) > > avoiding the import of the dl module. > > Hth, Martin > > richard apodaca wrote: > > Has anyone gotten the Python Open Babel interface > to > > work on amd64 Linux? I'm using rev 1578 of the svn > > trunk > > > > When I try to import openbabel, I get the > following > > error > > > > > >>>>import openbabel > > > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > > File > > "/usr/lib64/python2.4/site-packages/openbabel.py", > > line 3, in ? > > import dl > > ImportError: No module named dl > > > > I noticed a similar problem reported here, but no > > solution: > > > > > http://sourceforge.net/mailarchive/message.php?msg_id=37015184 > > > > I had no problems either compiling or installing > > pyopenbabel - just loading it in python. > > > > My system does lack the python dl module, which as > far > > as I can tell is supposed to be standard. In > googling > > around, I found several references to the python > dl > > module being unstable on amd64 - and therefore not > > available. > > > > So - has anyone found a workaround to this > problem? > > > > I tried one: comment out the code responsible for > > loading dl in the first place (openbabel.py): > > > > if sys.platform.find("linux") != -1: > > import dl > > sys.setdlopenflags(sys.getdlopenflags() | > > dl.RTLD_GLOBAL) > > > > I can in fact import openbabel after doing this. > The > > problem is that when using OBConversion, none of > the > > formats are loaded: > > > > > >>>>import openbabel > >>>>c=openbabel.OBConversion() > > > > ============================== > > *** Open Babel Error in LoadFormatFiles > > /usr/local/lib/openbabel/cmlreactlformat.so did > not > > load properly > > ============================== > > > > ... and dozens more load errors after this one ... > > > > thanks, > > Rich > > > > > > > > > > ____________________________ > > Richard Apodaca > > Blog: http://depth-first.com > > > > > > > > > ____________________________________________________________________________________ > > Everyone is raving about the all-new Yahoo! Mail > > (http://advision.webevents.yahoo.com/mailbeta/) > > > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support > web services, security? > > Get stuff done quickly with pre-integrated > technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > OpenBabel-scripting mailing list > > Ope...@li... > > > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > > > -- > Martin Vogt > Vorgebirgsstr. 14, D-53111 Bonn > Email: mo...@t-... Tel.: +49 > (0)228 634376 > ____________________________ Richard Apodaca Blog: http://depth-first.com ____________________________________________________________________________________ We have the perfect Group for you. Check out the handy changes to Yahoo! Groups (http://groups.yahoo.com) |