Skip to content

[house_auction] upgrade prettytable + wcwidth to fix wcwidth.width error#937

Merged
mmcky merged 1 commit into
mainfrom
fix-house-auction-prettytable
Jun 26, 2026
Merged

[house_auction] upgrade prettytable + wcwidth to fix wcwidth.width error#937
mmcky merged 1 commit into
mainfrom
fix-house-auction-prettytable

Conversation

@mmcky

@mmcky mmcky commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

Change house_auction's install cell from !pip install prettytable to !pip install -U prettytable wcwidth.

Why

prettytable 3.18.0 (released 2026-06-22) calls wcwidth.width() and requires wcwidth>=0.3.5, but the anaconda base ships wcwidth 0.2.13, which has no .width. The lecture's !pip install prettytable pulls 3.18.0 without upgrading wcwidth, so the cell print(PrettyTable) in present_dict fails on a full execution:

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

This was surfaced by forced full builds on both anaconda 2025.12 and 2026.06, with the identical error — so it's an upstream prettytable break, independent of the recent anaconda bump (#923).

Fix and verification

Adding -U ... wcwidth makes pip pull a wcwidth that has .width (0.8.1). Verified in an isolated venv — prettytable 3.18.0 + wcwidth 0.8.1, and a PrettyTable mimicking present_dict renders cleanly. The preview build on this PR also re-executes house_auction (its source changed), so it exercises the fix directly.

Notes

🤖 Generated with Claude Code

prettytable 3.18.0 (2026-06-22) calls wcwidth.width() and requires
wcwidth>=0.3.5, but the anaconda base ships wcwidth 0.2.13 (no .width),
and `!pip install prettytable` does not upgrade it, so the lecture fails
with `AttributeError: module 'wcwidth' has no attribute 'width'` on a full
build. Install with `-U prettytable wcwidth` so pip pulls a wcwidth (0.8.1)
that exposes .width.

Part of #935 (house_auction item; arviz items remain).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the house_auction lecture’s in-notebook dependency installation to avoid a runtime failure introduced by prettytable 3.18.0 when running against older base-Anaconda wcwidth (missing wcwidth.width()), keeping the lecture executable during full builds.

Changes:

  • Modify the house_auction install cell to upgrade/install both prettytable and wcwidth together (!pip install -U prettytable wcwidth).

@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-937--sunny-cactus-210e3e.netlify.app

Commit: 3c6a959

📚 Changed Lectures


Build Info

@mmcky mmcky merged commit 5ca0512 into main Jun 26, 2026
2 checks passed
@mmcky mmcky deleted the fix-house-auction-prettytable branch June 26, 2026 09:52
mmcky added a commit that referenced this pull request Jun 28, 2026
…ibility (#939)

prettytable 3.18.0 requires wcwidth>=0.3.5 (it calls wcwidth.width()), but base Anaconda 2026.06 ships wcwidth 0.2.14. The in-lecture '!pip install -U wcwidth' from #937 can't fix this: the kernel imports wcwidth at startup, so the already-cached module isn't reloaded by an in-session pip upgrade. Pin prettytable<3.18 (which works with wcwidth 0.2.14) instead. See #938.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants