Open Babel Error in OpenBabel::OBBuilder::GetFragmentCoord Rigid fragment C1CCCNC1 in rigid-fragments.txt has all zero coordinates
- [x] I believe this to be a bug with Open Babel
- [ ] This is a feature request
Environment Information
Open Babel version: 3.1.0
Operating system and version: Windows 10
Expected Behavior
mol = pybel.readstring("smi", 'BrC/C=C/c1ccc(O[C@@H]2CCCNC2)cc1')
mol.make3D()
Actual Behavior
jupyter lab Kernel dies with this output in the cmd
Open Babel Error in OpenBabel::OBBuilder::GetFragmentCoord
Rigid fragment C1CCCNC1 in rigid-fragments.txt has all zero coordinates
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.")