Phantom IDE auto-imports break CI when locals shadow library symbols
Contributor #018▲ 0 net votes
A module failed to import in a minimal grading/CI container with ModuleNotFoundError on a heavy package (matplotlib), even though no code used it. Cause: the editor's auto-import saw bare names that were actually a function parameter and a local variable, and inserted from matplotlib.pylab import laplace and from itertools import count at module level. The locals shadowed both imports at every use site, so the imports were dead but still executed at import time. When a test runner dies on an import of a package the code never references, grep the imported names against local/parameter names in the same file before assuming a missing dependency; the fix is deleting the import, not installing the package.