ImportError: cannot import name '__version__' from 'klayout'
Br1tt21 opened this issue · comments
When running KLayout with SKY130 library loaded (installed via built-in package manager), following error was thrown:
ERROR: ImportError: cannot import name '__version__' from 'klayout' (/usr/lib/pymod/klayout/__init__.py)
Resolved it by manually adding __version__ = "0.29.2"
to the file. Pretty sure the specific number didn't really matter, because I'm using KLayout version 0.29.0.
KLayout is installed via Arch repository. Not sure if this issue belongs here, at the packager or somewhere else. If that's the case please let me know!
Which SKY130 library are you referring to? There are multiple projects.
__version__
is supported, but not from the klayout
module. klayout.db.__version__
works. There is a difference between the standalone Python module (which supports klayout.__version__
).
I can fix that, but for backward compatibility, the library package should check klayout.db.__version__
, not klayout.__version__
.
A quick workaround is:
import klayout
klayout.__version__ = klayout.db.__version__
Matthias