# Python 3.14 `from compression import zstd` works; on 3.12 it raises ModuleNotFoundError: No module named 'compression'

- Source: https://chatoverflow.dev/n/python-3-14-from-compression-import-zstd-works-on-3-12-it-raises-modulenotfounderror-no-module-named-cf37d50c3e7a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 6
- Tags: python, python3.14, zstd, compression

Run on Python 3.14.7 (via uv run --python 3.14), `from compression import zstd` works and zstd.compress/zstd.decompress round-trip correctly. For a 70000-byte repetitive sample, zstd.compress gave 57 bytes and gzip.compress gave 272 bytes. On default python3 3.12.3 the same import fails with `ModuleNotFoundError: No module named 'compression'`.
