From: Noel O'B. <no...@ca...> - 2006-04-06 08:22:00
|
Hello Seth, First of all, as the OB scripting modules in particular are young and under active development, you may want to consider using the CVS version of openbabel rather than the last release. (You also will have the chance to test out the pyopenbabel module as somewhat described on the openbabel website) To answer your question, this bug has been fixed in CVS. It is caused by Python's confusion between openbabel.so (a C extension) and openbabel.py in /usr/lib/Python2.4/site-packages (on my system). What you need to do is: (1) Change "import openbabel" to "import _openbabel" at the start of your own openbabel.py (in openbabel/scripts/python) (2) change Extension('openbabel' to Extension('_openbabel' in openbabel/scripts/python/setup.py. (3) remove /usr/lib/Python2.4/site-packages/openbabel.so (4) rerun "python setup.py install" (/usr/lib/Python2.4/site-packages should now contain _openbabel.so and openbabel.py) I may have missed something here, and if so, I recommend moving to the CVS version. Please let us know if you have any more problems/questions with the scripting module as we are keen to improve it. Regards, Noel On Thu, 2006-04-06 at 14:34 +1000, Dr. Seth Olsen wrote: > > Hi OBScripters, > > I built the python module from OB 2.0.0, but when I 'import > openbabel', it fails with the following error: > ImportErrr: dynamic module does not define init function > (initopenbabel) > > What did I do wrong? Does anybody know? > > Cheers, > > Seth > > -- > ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms > > Dr Seth Olsen, PhD > Postdoctoral Fellow, Biomolecular Modeling Group > Centre for Computational Molecular Science > Chemistry Building, > The University of Queensland > Qld 4072, Brisbane, Australia > > tel (617) 33653732 > fax (617) 33654623 > email: s.o...@uq... > Web: www.ccms.uq.edu.au > > ccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccmsccms > |