Implementing openbabel.py, pybel.py

97 views
Skip to first unread message

stevenc

unread,
Sep 5, 2012, 2:06:27 AM9/5/12
to pytho...@oma.be

Hello all,

my main incentive to start learning python was to use the
cheminformatics software openbabel.py and pybel.py (which uses
openbabel.py). I tried to import it under python 2.7, in windows, but
got the following error message:


>>> import pybel
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pybel
File "C:\Python27\lib\site-packages\pybel.py", line 16, in <module>
import openbabel as ob
File "C:\Python27\lib\site-packages\openbabel.py", line 28, in
<module>
_openbabel = swig_import_helper()
File "C:\Python27\lib\site-packages\openbabel.py", line 24, in
swig_import_helper
_mod = imp.load_module('_openbabel', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.



I am not sure what to make from this error message. The modules pybel
and openbabel are present in Python27\lib\site-packages\.

Greetings,
Steven

Thomas Lecocq

unread,
Sep 5, 2012, 2:23:07 AM9/5/12
to pytho...@oma.be
Hi,

Le 05/09/2012 08:06, stevenc a écrit :
>
> Hello all,
>
> my main incentive to start learning python was to use the
> cheminformatics software openbabel.py and pybel.py (which uses
> openbabel.py). I tried to import it under python 2.7, in windows, but
> got the following error message:
>
>
>>>> import pybel
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in <module>
> import pybel
> File "C:\Python27\lib\site-packages\pybel.py", line 16, in <module>
> import openbabel as ob
> File "C:\Python27\lib\site-packages\openbabel.py", line 28, in <module>
> _openbabel = swig_import_helper()
> File "C:\Python27\lib\site-packages\openbabel.py", line 24, in
> swig_import_helper
> _mod = imp.load_module('_openbabel', fp, pathname, description)
> ImportError: DLL load failed: The specified module could not be found.
>
>
>
is Swig properly installed ? How did you install pybel (easy_install or
pre built exe binaries) ?

Thomas

> I am not sure what to make from this error message. The modules pybel
> and openbabel are present in Python27\lib\site-packages\.
>
> Greetings,
> Steven

--
Dr. Thomas Lecocq
Geologist

Seismology - Gravimetry
Royal Observatory of Belgium

*
* * * * *
* * * *
---------
http://www.seismology.be
http://twitter.com/#!/Seismologie_be

Vincent Letocart

unread,
Sep 5, 2012, 3:53:04 AM9/5/12
to stevenc, pytho...@oma.be
It's a relative path: where is that exactly on your system ?
What about PYHTONPATH ?

Vincent.

--
Not one hundred percent efficient, of course ... but nothing ever is.
-- Kirk, "Metamorphosis", stardate 3219.8

Ruben De Visscher

unread,
Sep 5, 2012, 4:05:35 AM9/5/12
to pytho...@oma.be
Hello,

is it possible that you only installed the python wrapper and not
openbabel itself?
The error message "DLL load failed" means it is trying to load a
compiled library (not python code), and not finding it.

Regards,

Ruben

Steven Compernolle

unread,
Sep 5, 2012, 4:21:48 AM9/5/12
to Ruben De Visscher, pytho...@oma.be
On 09/05/12 10:05, Ruben De Visscher wrote:
> Hello,
>
> is it possible that you only installed the python wrapper and not
> openbabel itself?
Hello Ruben,

I did install openbabel 2.3.1 with the windows binary installer, without
any error message. The GUI of openbabel is running fine. But according
to the documentation, I should set the environment variable
BABEL_DATADIR to the 'data' folder. This data folder seems to be missing.
Regards,
Steven
--
Steven Compernolle
Scientific Researcher
Ringlaan 3
1180 Brussel
Tel: 02/8909862

Reply all
Reply to author
Forward
0 new messages