Open StashOfCode opened 3 years ago
Thanks for opening your first issue here! Be sure to follow the issue template!
Try this one too. Babel hangs with it forever BrC/C=C/c1ccc(O[C@@H]2C[C@H]3CC[C@H]2NC3)cc1
. "smilies to sdf" with "generate 3d coords" checked
Open Babel 3.1.1 has the same problem when generating 3d structure (does not matter the output format) from .smi files.
Is there a at least a way to catch this error without resorting to subprocesses?
try:
mol = pybel.readstring("smi", 'BrC/C=C/c1ccc(O[C@@H]2CCCNC2)cc1')
mol.make3D()
except:
print("failed")
This does not work
okay you can check if BABEL_DATADIR is correctly set (assuming you have conda install). This worked for me (setting manually).
import os
os.environ["BABEL_DATADIR"] = "C:\Users\...\anaconda3\envs\...\share\openbabel" # Adjust for your conda path
import openbabel
import openbabel.pybel as pybel
mol = pybel.readstring("smi", 'BrC/C=C/c1ccc(O[C@@H]2CCCNC2)cc1')
mol.make3D()
print("everything is fine.")
Hi, I understand that with this case, there is no way for us to convert 3D structure by using pybel. Is it right?
No, normally it works. You just need to make sure that the BABEL_DATADIR environmental variable is set correctly. How you do that depends on your installation method, see e.g. https://openbabel.org/docs/Installation/install.html#troubleshooting-build-problems
Environment Information
Open Babel version:
3.1.0
Operating system and version:Windows 10
Expected Behavior
Actual Behavior
jupyter lab Kernel dies with this output in the cmd