python import openbabel failure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

python import openbabel failure

TJ O'Donnell

I've built and installed the latest openbabel revision 3967
There are no errors reported, babel runs fine.
I get an error from python on import openbabel
I've set my PYTHONPATH to the new /usr/local/lib/python2.6/dist-packages
and get this
Any ideas what might be happening?

TJ O'Donnell

>>> import openbabel
import openbabel # from /usr/local/lib/python2.6/dist-packages/openbabel.py
# can't create /usr/local/lib/python2.6/dist-packages/openbabel.pyc
dlopen("/usr/lib/python2.6/lib-dynload/dl.so", 2);
import dl # dynamically loaded from /usr/lib/python2.6/lib-dynload/dl.so
# /usr/lib/python2.6/new.pyc matches /usr/lib/python2.6/new.py
import new # precompiled from /usr/lib/python2.6/new.pyc
import imp # builtin
dlopen("/usr/local/lib/python2.6/dist-packages/_openbabel.so", 102);
# /usr/lib/python2.6/re.pyc matches /usr/lib/python2.6/re.py
import re # precompiled from /usr/lib/python2.6/re.pyc
# /usr/lib/python2.6/sre_compile.pyc matches
/usr/lib/python2.6/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.6/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.6/sre_parse.pyc matches /usr/lib/python2.6/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.6/sre_parse.pyc
# /usr/lib/python2.6/sre_constants.pyc matches
/usr/lib/python2.6/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.6/sre_constants.pyc
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 70, in
<module>
     _openbabel = swig_import_helper()
   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 66, in
swig_import_helper
     _mod = imp.load_module('_openbabel', fp, pathname, description)
ImportError: dynamic module does not define init function (init_openbabel)



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: python import openbabel failure

Noel O'Boyle
Administrator
I'm guessing that you need to force Swig to run again. If so, try
"touch scripts/openbabel-python.i" and running make again. Look at the
output and verify that it runs SWIG and compiles the bindings
successfully. Also make sure that /usr/local/lib is at the front of
your LD_LIBRARY_PATH before running python.

- Noel

On 13 August 2010 00:12, TJ O'Donnell <[hidden email]> wrote:

>
> I've built and installed the latest openbabel revision 3967
> There are no errors reported, babel runs fine.
> I get an error from python on import openbabel
> I've set my PYTHONPATH to the new /usr/local/lib/python2.6/dist-packages
> and get this
> Any ideas what might be happening?
>
> TJ O'Donnell
>
>>>> import openbabel
> import openbabel # from /usr/local/lib/python2.6/dist-packages/openbabel.py
> # can't create /usr/local/lib/python2.6/dist-packages/openbabel.pyc
> dlopen("/usr/lib/python2.6/lib-dynload/dl.so", 2);
> import dl # dynamically loaded from /usr/lib/python2.6/lib-dynload/dl.so
> # /usr/lib/python2.6/new.pyc matches /usr/lib/python2.6/new.py
> import new # precompiled from /usr/lib/python2.6/new.pyc
> import imp # builtin
> dlopen("/usr/local/lib/python2.6/dist-packages/_openbabel.so", 102);
> # /usr/lib/python2.6/re.pyc matches /usr/lib/python2.6/re.py
> import re # precompiled from /usr/lib/python2.6/re.pyc
> # /usr/lib/python2.6/sre_compile.pyc matches
> /usr/lib/python2.6/sre_compile.py
> import sre_compile # precompiled from /usr/lib/python2.6/sre_compile.pyc
> import _sre # builtin
> # /usr/lib/python2.6/sre_parse.pyc matches /usr/lib/python2.6/sre_parse.py
> import sre_parse # precompiled from /usr/lib/python2.6/sre_parse.pyc
> # /usr/lib/python2.6/sre_constants.pyc matches
> /usr/lib/python2.6/sre_constants.py
> import sre_constants # precompiled from /usr/lib/python2.6/sre_constants.pyc
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 70, in
> <module>
>     _openbabel = swig_import_helper()
>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 66, in
> swig_import_helper
>     _mod = imp.load_module('_openbabel', fp, pathname, description)
> ImportError: dynamic module does not define init function (init_openbabel)
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: python import openbabel failure

TJ O'Donnell
That did it!  Thanks, Noel.

TJ

On 8/13/2010 1:36 AM, Noel O'Boyle wrote:

> I'm guessing that you need to force Swig to run again. If so, try
> "touch scripts/openbabel-python.i" and running make again. Look at the
> output and verify that it runs SWIG and compiles the bindings
> successfully. Also make sure that /usr/local/lib is at the front of
> your LD_LIBRARY_PATH before running python.
>
> - Noel
>
> On 13 August 2010 00:12, TJ O'Donnell<[hidden email]>  wrote:
>>
>> I've built and installed the latest openbabel revision 3967
>> There are no errors reported, babel runs fine.
>> I get an error from python on import openbabel
>> I've set my PYTHONPATH to the new /usr/local/lib/python2.6/dist-packages
>> and get this
>> Any ideas what might be happening?
>>
>> TJ O'Donnell
>>
>>>>> import openbabel
>> import openbabel # from /usr/local/lib/python2.6/dist-packages/openbabel.py
>> # can't create /usr/local/lib/python2.6/dist-packages/openbabel.pyc
>> dlopen("/usr/lib/python2.6/lib-dynload/dl.so", 2);
>> import dl # dynamically loaded from /usr/lib/python2.6/lib-dynload/dl.so
>> # /usr/lib/python2.6/new.pyc matches /usr/lib/python2.6/new.py
>> import new # precompiled from /usr/lib/python2.6/new.pyc
>> import imp # builtin
>> dlopen("/usr/local/lib/python2.6/dist-packages/_openbabel.so", 102);
>> # /usr/lib/python2.6/re.pyc matches /usr/lib/python2.6/re.py
>> import re # precompiled from /usr/lib/python2.6/re.pyc
>> # /usr/lib/python2.6/sre_compile.pyc matches
>> /usr/lib/python2.6/sre_compile.py
>> import sre_compile # precompiled from /usr/lib/python2.6/sre_compile.pyc
>> import _sre # builtin
>> # /usr/lib/python2.6/sre_parse.pyc matches /usr/lib/python2.6/sre_parse.py
>> import sre_parse # precompiled from /usr/lib/python2.6/sre_parse.pyc
>> # /usr/lib/python2.6/sre_constants.pyc matches
>> /usr/lib/python2.6/sre_constants.py
>> import sre_constants # precompiled from /usr/lib/python2.6/sre_constants.pyc
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in<module>
>>    File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 70, in
>> <module>
>>      _openbabel = swig_import_helper()
>>    File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 66, in
>> swig_import_helper
>>      _mod = imp.load_module('_openbabel', fp, pathname, description)
>> ImportError: dynamic module does not define init function (init_openbabel)
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by
>>
>> Make an app they can't live without
>> Enter the BlackBerry Developer Challenge
>> http://p.sf.net/sfu/RIM-dev2dev
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss