Skip to content

fix(deps): require napari>=0.5.5 for NumPy 2 compatibility - #37

Merged
lguerard merged 1 commit into
mainfrom
fix/napari-numpy2
Jun 25, 2026
Merged

fix(deps): require napari>=0.5.5 for NumPy 2 compatibility#37
lguerard merged 1 commit into
mainfrom
fix/napari-numpy2

Conversation

@lguerard

Copy link
Copy Markdown
Contributor

view_in_napari() failed at napari.Viewer() under NumPy 2:

ValidationError: ConstantStringEncoding … Unable to avoid copy while creating an array as requested.

The env had napari 0.4.x (pydantic v1), which calls np.array(..., copy=False) — NumPy 2 raises instead of copying. napari ≥ 0.5 is NumPy-2 / pydantic-2 compatible. Pin the napari extra to >=0.5.5.

Existing env: pixi add --pypi "napari[all]>=0.5.5" and restart the kernel.

🤖 Generated with Claude Code

Old napari 0.4.x calls np.array(..., copy=False), which raises under
NumPy 2 and breaks napari.Viewer() with a ValidationError. Pin the
napari extra to >=0.5.5 (NumPy 2 + pydantic 2 compatible).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lguerard
lguerard merged commit 89f83b0 into main Jun 25, 2026
@lguerard
lguerard deleted the fix/napari-numpy2 branch June 25, 2026 14:30
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.

1 participant