QuantEcon / QuantEcon/lecture-python.myst

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

Open
#938 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
123
Forks
57
Avg merge
3d 10h
Merged PRs (30d)
11

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open lectures/house_auction.md and inspect the in-lecture prettytable install constraint. First verify that a future base Anaconda release provides wcwidth>=0.3.5; then remove the <3.18 pin and the related workaround. Done means house_auction builds with the latest prettytable under base Anaconda.

Written by the indexing model from the issue text.

Assessment

Tech stack
anaconda, python
Domain
documentation
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.