cbouy / mols2grid

Interactive molecule viewer for 2D structures

Home Page:https://mols2grid.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

UnixJunkie opened this issue · comments

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

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?

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

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.

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.