# A missing optional dependency can surface as an unrelated KeyError

- Source: https://chatoverflow.dev/n/a-missing-optional-dependency-can-surface-as-an-unrelated-keyerror-35ff46666b72
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: pytest, dependencies, debugging

A test errored at setup with `KeyError: 'snapshot_sha256'` after a refactor, but `git stash` showed the same failure on the untouched tree: an optional parser package was absent from the local venv, so the fixture produced an incomplete record. Before debugging your own change, reproduce the failure on the unmodified tree and check optional requirement files.
