Skip to content

anaconda 2026.06: Build Cache fails — 3 notebooks (pandas 3.0 read-only + quantecon_book_networks pkg_resources) #775

Closed

Description

@mmcky

Validating the anaconda=2025.12 → 2026.06 upgrade (#773) with a cache.yml "Build Cache" run dispatched on the branch. The -W --keep-going build fails (build finished with problems, 19 warnings): https://github.com/QuantEcon/lecture-python-intro/actions/runs/28221751009. Three notebooks fail to execute, from two distinct root causes. The undefined label warnings in the log (lorenz_gini, us_15sectors, financial_network, …) are downstream fallout from cells that never ran, not separate problems.

Lecture Root cause Fix owner
inequality.md pandas 3.0 read-only array this repo (lecture edit)
input_output.md quantecon_book_networks imports removed pkg_resources upstream package
networks.md same as input_output.md upstream package

1. pandas 3.0 read-only arrays — inequality.md. Under pandas 3.0 Copy-on-Write, np.asarray() of a Series returns a non-writeable array, so the in-place shuffle raises:

Cell In[7], line 25
---> 25  rd.shuffle(y)        # y = np.asarray(df[df['year']==year][var].repeat(counts))
ValueError: assignment destination is read-only

This is fixable here: take a writeable copy, e.g. y = np.asarray(y).copy() (or y = np.array(y)).

2. quantecon_book_networks imports removed pkg_resources — input_output.md, networks.md.

File .../site-packages/quantecon_book_networks/data.py:1
----> 1 import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

This is an upstream package bug, tracked at QuantEcon/quantecon-book-networks#21. These two lectures stay broken until a fixed quantecon_book_networks is released and pinned here; the short-term stopgap is adding setuptools to environment.yml to restore pkg_resources.

Status. #773 is not mergeable yet. It needs (1) the inequality.md copy fix, and (2) the upstream quantecon_book_networks fix released and pinned (or the setuptools stopgap). Found during the cross-repo anaconda 2026.06 validation sweep.

Activity

  1. mmcky commented on Jun 26, 2026

    @mmcky
    ContributorAuthor

    Opened #776 to fix cause 1 (the pandas 3.0 read-only array in inequality.md). Cause 2 (input_output + networks) remains blocked on the upstream quantecon_book_networks fix (QuantEcon/quantecon-book-networks#21); once that ships and is pinned here (or setuptools is added as a stopgap), a re-run of the cache build should go green.

  2. mmcky commented on Jun 26, 2026

    @mmcky
    ContributorAuthor

    Resolved. The full Build Cache run on main under anaconda 2026.06 is green — run 28233927707 completed with conclusion=success, executing every notebook with -W --keep-going. All three root-cause notebooks now execute, and the downstream undefined label warnings have cleared.

    Landed via:

    PR Fix Cause
    #776 Writeable copy before rd.shuffle in inequality.md pandas 3.0 read-only array
    #777 Pinned quantecon_book_networks==1.6 in input_output.md + networks.md pkg_resources removed on the 2026.06 stack
    #773 Bumped anaconda 2025.12 → 2026.06 the upgrade itself

    #777 picks up the upstream pkg_resources → importlib.resources migration from QuantEcon/quantecon_book_networks#21 (released as 1.6). The setuptools stopgap was therefore not needed.

    Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions