Skip to content

[house_auction] Pin prettytable<3.18 for base-Anaconda wcwidth compatibility#939

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

[house_auction] Pin prettytable<3.18 for base-Anaconda wcwidth compatibility#939
mmcky merged 1 commit into
mainfrom
fix-house-auction-prettytable-pin

Conversation

@mmcky

@mmcky mmcky commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Pins house_auction's in-lecture install to prettytable<3.18, reverting the !pip install -U prettytable wcwidth from #937 (which does not actually fix the full-build failure — see below).

The failure. On a full -W cache build, house_auction fails with AttributeError: module 'wcwidth' has no attribute 'width'. prettytable 3.18.0 calls wcwidth.width() and requires wcwidth>=0.3.5, but base Anaconda (2026.06) ships wcwidth 0.2.14, which has no .width.

Why #937's in-lecture upgrade can't work. The Jupyter kernel imports wcwidth at startup (via IPython/ipykernel), so it is already cached in sys.modules as 0.2.14 before any cell runs. A runtime !pip install -U wcwidth upgrades the package on disk but does not reload the already-imported module in the running kernel — only a kernel restart would. #937 was verified in a clean venv (a fresh process, which naturally picks up the new wcwidth), which masked this. It also means a base-Anaconda reader running the notebook top-to-bottom hits the same failure, not just CI.

The fix. prettytable ≤ 3.17.0 depends only on wcwidth (unpinned) and works with base Anaconda's 0.2.14, so pinning <3.18 removes the need for any wcwidth upgrade. This keeps the lecture runnable in base Anaconda — pinning wcwidth in environment.yml instead would only green CI while leaving a base-Anaconda reader broken.

Follow-up. Tracked in #938: drop the <3.18 pin and return to the latest prettytable once a base Anaconda release ships wcwidth>=0.3.5.

🤖 Generated with Claude Code

…ibility

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>

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

This PR updates the house_auction lecture’s in-notebook dependency installation to avoid the prettytable 3.18+ / base-Anaconda wcwidth incompatibility that causes full -W builds to fail.

Changes:

  • Replaces the runtime pip install -U prettytable wcwidth with a version constraint that installs prettytable<3.18 in the lecture.

@github-actions

Copy link
Copy Markdown

📖 Netlify Preview Ready!

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

Commit: f521354

📚 Changed Lectures


Build Info

@mmcky mmcky merged commit d1bebc3 into main Jun 28, 2026
2 checks passed
@mmcky mmcky deleted the fix-house-auction-prettytable-pin branch June 28, 2026 02:28
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