Hi,

I have so far been able to build the openbabel solution in Debug mode with
Python bindings enabled. I see that the openbabel-2.dll and openbabel.py
have been built in the Debug folder inside the "bin" folder. The Debug
folder in the "src" folder also contains two library files named
"openbabel-2.lib" and "openbabel-2.exp". 

My first question now is how do I use the above built files to run a python
code (importing pybel) in Visual studio? I have so far been unsuccessful
trying to run a test program in pybel via Visual studio. The test program is
as follows:

import pybel
mol = pybel.readstring("smi", "CC(=O)Br")
mol.make3D()
print(mol.write("sdf"))

The openbabel.py source file was added to the Visual studio solution before
running the test program and it throws an exception error saying "No module
found named openbabel". Any advice on how to run the python code using the
generated libraries or source file in visual studio is appreciated!

The pybel test program worked when I ran it in command line without visual
studio by just installing the python bindings executable for openbabel GUI.
I would however like to use openbabel in visual studio rather than just
running test programs via command line, which is why I built the opebabel
solution in visual studio in the first place. 

My second question is regarding running python programs in command line,
have you ever tried to run the python program that imports pybel from inside
a batch file? For me this throws an error "ModuleNotFoundError: No module
named pybel". Any thoughts in why this is the case? I double checked my
environmental variables for the correct python value and that the dlls and
python source files for pyben and openbabel have indeed been saved inside
site packages of the "lib" folder inside the Python installation directory.

Thanks,
Ampritta
 



--
Sent from: http://forums.openbabel.org/General-discussion-f3090658.html


_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to