Repository navigation
A follow-up to 0.4.0, found by a blind test on the published wheel.
A missing klayout now says what to install. Every other optional
dependency in the imaging domain already failed instructively — numpy,
scipy and pillow all name the pip command. klayout did not, and it is
the hardest of them to diagnose.
An empty klayout directory left somewhere on the path (a stale
install, a py.typed-only folder) is a valid NAMESPACE package, so
import klayout succeeds and only klayout.db fails. The bare error
reads "no module named klayout.db", which tells you the package is
installed and merely incomplete — so you go looking for a broken
sub-module instead of an absent package.
The error now names the interpreter, gives the pip command, and when a
shim really is shadowing the package it says where that directory is
and why the message mentioned klayout.db.
0.4.0 的后续修复,来自对已发布 wheel 的盲测。
缺
klayout时的报错现在会指路。同一个域里 numpy/scipy/pillow 缺失
都有指路文案,唯独 klayout 本体没有,而它恰恰最难自己诊断:一个空的
klayout目录留在 path 上就是个合法的 namespace 包,于是import klayout成功、只有klayout.db失败,报错看起来像"包装了、只是缺个
子模块",把人引向错误的方向。现在报错会点名解释器、给出 pip 命令,
并在确实有空壳顶包时告诉你那个目录在哪、以及为什么报错说的是
klayout.db。
If you are upgrading from 0.3.x, read the 0.4.0 notes — that is where the breaking change is.