Skip to content

Restore prettytable to latest (>=3.18) in house_auction once base Anaconda ships wcwidth>=0.3.5 #938

Description

@mmcky

lectures/house_auction.md pins its in-lecture install to prettytable<3.18 as a workaround. This is a tracking issue to drop that pin and return to the latest prettytable once base Anaconda is compatible.

Why the pin is needed. prettytable 3.18.0 requires wcwidth>=0.3.5 (it calls wcwidth.width()), but base Anaconda (2026.06) ships wcwidth 0.2.14, which has no .width attribute. So a full build of house_auction fails with AttributeError: module 'wcwidth' has no attribute 'width'.

Why we can't just upgrade wcwidth in-lecture. The Jupyter kernel imports wcwidth at startup (it's pulled in by IPython/ipykernel), so by the time any cell runs it is already cached in sys.modules as 0.2.14. A runtime !pip install -U wcwidth upgrades the package on disk but does not reload the already-imported module in the running kernel — that only takes effect after a kernel restart. This is exactly why #937's !pip install -U prettytable wcwidth did not fix the build (it was verified in a clean venv, which is a fresh process and therefore picks up the new version, masking the kernel-cache behaviour). This matches our model that lectures should run in base Anaconda: pinning wcwidth in environment.yml would only green the CI build while leaving a base-Anaconda reader broken, so the correct fix is to pin the consumer (prettytable) to a version compatible with the wcwidth that base Anaconda ships.

Action when unblocked. When a future base Anaconda release ships wcwidth>=0.3.5, remove the <3.18 constraint in lectures/house_auction.md and return to the latest prettytable (the in-lecture upgrade will then no longer be necessary).

Context: the immediate break was in #937; the (now-closed) parent was #935.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions