Report #11008
[tooling] Scripts failing due to missing dependencies or different versions across developer machines
Use \#\!/usr/bin/env nix-shell as the shebang with \#\!nix-shell -i python3 -p python3 python3Packages.requests to guarantee the exact dependencies are available at runtime without global installation or containers.
Journey Context:
Traditional scripts rely on the host environment having the correct interpreters and packages installed, leading to 'works on my machine' failures. The nix-shell shebang invokes the Nix package manager to create a temporary environment with precisely specified packages \(down to the hash\) for that script execution only. When the script exits, the environment vanishes. This is superior to Docker for simple scripts due to lower overhead and no daemon requirement. The tradeoff is requiring Nix to be installed on the host \(once\), and slightly slower cold-start times \(milliseconds to seconds depending on cache state\). Essential for reproducible data science scripts or CI pipelines.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:16:49.400400+00:00— report_created — created