Skip to content

Commit 7c56b28

Browse files
authored
Fix pybel import (#54)
Fix pybel import that is now installed with conda openbabel package.
1 parent e26c997 commit 7c56b28

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

aiidalab_widgets_base/structures.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,10 @@ def pymol_2_ase(pymol):
387387

388388
def _optimize_mol(self, mol):
389389
"""Optimize a molecule using force field (needed for complex SMILES)."""
390-
from openbabel import pybel # pylint:disable=import-error
390+
391+
# Note, the pybel module imported below comes together with openbabel package. Do not confuse it with
392+
# pybel package available on PyPi: https://pypi.org/project/pybel/
393+
import pybel # pylint:disable=import-error
391394

392395
self.output.value = "Screening possible conformers {}".format(self.SPINNER) #font-size:20em;
393396

@@ -408,7 +411,11 @@ def _optimize_mol(self, mol):
408411
def _on_button_pressed(self, change): # pylint: disable=unused-argument
409412
"""Convert SMILES to ase structure when button is pressed."""
410413
self.output.value = ""
411-
from openbabel import pybel # pylint:disable=import-error
414+
415+
# Note, the pybel module imported below comes together with openbabel package. Do not confuse it with
416+
# pybel package available on PyPi: https://pypi.org/project/pybel/
417+
import pybel # pylint:disable=import-error
418+
412419
if not self.smiles.value:
413420
return
414421

0 commit comments

Comments
 (0)