cbouy / mols2grid

Interactive molecule viewer for 2D structures
https://mols2grid.readthedocs.io
Apache License 2.0
206 stars 25 forks source link

AttributeError: partially initialized module 'mols2grid' has no attribute 'display' (most likely due to a circular import) #15

Closed UnixJunkie closed 2 years ago

UnixJunkie commented 2 years ago

I have never seen this error in my life.

Is it not OK to have 'import mols2grid' inside of some python source file?

Then just call mols2grid.display then mols2grid.save?

UnixJunkie commented 2 years ago

Ok, apparently, you either call display OR save... Not one then the other.

UnixJunkie commented 2 years ago

Ok, this error was due to having created a script itself called mols2grid, that was importing the mols2grid library. Renaming this script sdf2grid, for example, solves this issue.

cbouy commented 2 years ago

Hey @UnixJunkie

Glad you could solve this one by yourself!
FYI there's currently a bug in mols2grid.save which makes it unusable but it will be fixed soon. In the meantime you'll have to use the mols2grid.MolGrid class if you want to save it as an HTML document.