Skip to content

Template 0.1.22: TensorFlow apps install on Windows with an NVIDIA GPU; version cell finds the notebook - #39

Merged
guijacquemet merged 1 commit into
mainfrom
claude/stardist-labconstrictor-plan-aizdd6
Nov 11, 2026
Merged

guijacquemet merged 1 commit into
mainfrom
claude/stardist-labconstrictor-plan-aizdd6

Conversation

@guijacquemet

Copy link
Copy Markdown
Collaborator

Summary

1. On Windows computers with an NVIDIA driver, TensorFlow apps fail to install.

How it happens:

  • post_install.bat installs requirements_gpu.lock.txt whenever it finds nvidia-smi.
  • merge_requirements.py rewrote tensorflow to tensorflow[and-cuda] for every system.
  • That extra lists nvidia-* packages with no platform marker, and some of them only have Linux wheels (nvidia-nccl-cu12 has never had a Windows wheel).
  • The universal uv lock therefore pins them for Windows too, pip reports "No matching distribution", and the installer stops with "Application requirements installation failed".

The fix: in the GPU file, tensorflow now becomes two lines:

  • tensorflow[and-cuda]==X ; sys_platform == "linux"
  • tensorflow==X ; sys_platform != "linux"

If the line already has a marker, it is kept and combined with and. TensorFlow has had no native Windows GPU build since 2.10, so Windows loses nothing.

2. The version-cell snippet (notebook_upload.md) always printed "not listed" on Colab. It looked the notebook up at the top level of notebook_latest_versions.yaml, but sync_notebook_versions.py writes that file grouped by folder. The snippet now looks inside the folder groups.

Migration 0.1.21 → 0.1.22 applies both changes to existing apps:

  • It only touches known blocks, and running it twice changes nothing.
  • It keeps the files' line endings.
  • It skips customised files and never creates missing ones.
  • Notebooks that already contain the old snippet are not edited. The design note explains the one-line manual fix.

Found while planning a StarDist 2D (TensorFlow 2.20) LabConstrictor app.

Evidence

GPU lock for a StarDist stack (TF 2.20, Python 3.12), checked with uv pip install --dry-run --python-platform ...:

Lock Windows x86_64 macOS arm64 Linux x86_64
0.1.21 No solution n/a (CPU file is used) OK
0.1.22 OK, 106 packages, no nvidia-* OK OK, 119 packages including nvidia-* (every one marked sys_platform == 'linux')

Tests

  • python -m pytest tests -q: 235 passed, 246 subtests passed.
  • New file tests/test_template_sync_0_1_22.py covers:
    • the GPU lines;
    • the version-cell snippet lookup;
    • the migration on 0.1.21 files, with LF and CRLF line endings;
    • running the migration twice (nothing changes the second time);
    • customised files and missing files;
    • the sync.py chain.
  • test_template_sync_0_1_21.py: the manifest-version check now accepts any later version, and its chain test pins its copy of the manifest to 0.1.21. This is the same pattern the 0.1.20 test uses.
  • ruff check and mypy are clean.
  • Not verified: a real installer run on a Windows computer with an NVIDIA GPU. The lock results come from uv's resolver for each platform.

Checklist

  • Docs that name the changed behaviour are updated: .tools/docs/notebook_upload.md (snippet), .tools/docs/notebook_requirements.md (what the GPU file does for TensorFlow), the new .tools/docs/migration_0_1_22.md, and a link in .tools/docs/README.md.
  • Bumped template_version to 0.1.22. Users must regenerate the GPU lock and release a new installer.
  • Screenshots still valid. No UI changed.

Generated by Claude Code

…eads the grouped version file

The GPU requirements file rewrote tensorflow to tensorflow[and-cuda] for every
system. The extra lists Linux-only nvidia-* wheels without a platform marker,
so the universal GPU lock pinned them for Windows too and pip failed on every
Windows computer with an NVIDIA driver (post_install.bat picks the GPU file).
The GPU file now has tensorflow[and-cuda] for sys_platform == "linux" and plain
tensorflow elsewhere.

The version cell snippet in notebook_upload.md looked the notebook up at the
top level of notebook_latest_versions.yaml, which is grouped by folder, so
Colab users always read "not listed".

Migration 0.1.21 -> 0.1.22 applies both changes surgically (idempotent, keeps
line endings, skips customised files). Design note: migration_0_1_22.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WX6rdRdA72nsUjZvTXFSbP
@guijacquemet
guijacquemet merged commit 58542f8 into main Nov 11, 2026
4 checks passed
@IvanHCenalmor
IvanHCenalmor deleted the claude/stardist-labconstrictor-plan-aizdd6 branch November 12, 2026 23:17
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