Skip to content

Full-build failures from in-lecture pip packages (prettytable 3.18.0, arviz) — fix in-lecture #935

Description

@mmcky

Context

These lectures run on base anaconda plus a few in-lecture !pip install cells for packages anaconda doesn't ship (e.g. arviz, pymc, prettytable). Those extras are intentionally unpinned; the weekly full build (cache.yml) is what surfaces it when an upstream release of one of them breaks a lecture. The fix is in-lecture (or waiting out a transient upstream break), not pinning. This issue tracks the breakages currently surfaced by full builds so they don't get lost (the normal preview CI hides them — it restores the build-cache from main, so unchanged notebooks don't re-execute).

Surfaced while validating the anaconda 2026.06 bump (#923) with forced full builds. None of these is caused by the bump — the bump's only genuine regression (the Hansen lectures) is already fixed in #925/#926, and they now execute cleanly under anaconda 2026.06 / pandas 3.0.

1. house_auctionprettytable 3.18.0 vs base wcwidth

AttributeError: module 'wcwidth' has no attribute 'width'

Raised from present_dict(bid_info)print(PrettyTable).

Root cause: prettytable 3.18.0 (released 2026-06-22) requires wcwidth>=0.3.5 and calls wcwidth.width() (a function added in wcwidth 0.3.x). The anaconda base ships wcwidth 0.2.13, which has no .width, and the lecture's !pip install prettytable pulls 3.18.0 without bringing wcwidth up to >=0.3.5. Result: any build today fails, on either anaconda base (2025.12 and 2026.06) — main's last good weekly build (2026-06-22 04:38) just predates the 3.18.0 upload.

Suggested in-lecture fix: ensure a current wcwidth at runtime alongside prettytable (e.g. !pip install -U prettytable wcwidth), or revisit once prettytable ships a 3.18.x fix. (prettytable has prior history of not pulling wcwidth correctly — see prettytable/prettytable#362.)

2. ar1_bayes, ar1_turningptsaz.plot_trace(figsize=...)

az.plot_trace(trace, figsize=(17,6)) (ar1_bayes lines 214/272, ar1_turningpts line 331) fails under some arviz releases. Because !pip install arviz pymc is unpinned, whether it fails is build-day-dependent: it failed on the 2026-06-22 main full build but passed in the 2026-06-26 forced builds.

Suggested in-lecture fix: when it recurs, update the trace-plot sizing to the current arviz API.

Notes

  • Filed so ⬆️ Bump anaconda from 2025.12 to 2026.06 #923 (anaconda 2025.12 → 2026.06) is not blocked on pre-existing/upstream dependency breakage. The bump itself is clean for lecture logic.
  • A main control full build (anaconda 2025.12, built 2026-06-26) is running to confirm house_auction fails identically on the current base; result to be appended.

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