Skip to main content

pydub2-compat

Optional add-on for pydub2. Once it is installed, import pydub gives you pydub2. Most packages write import pydub or from pydub import AudioSegment. This makes those lines load pydub2 without touching the code of those packages. pydub.AudioSegment is pydub2.AudioSegment, and the same for pydub.utils, silence, effects, generators, playback, exceptions, audio_segment, scipy_effects and logging_utils.

It is opt in. pydub2 alone never takes over the name pydub. Install it with pip install pydub2-compat. The real pydub can stay installed, gradio and others depend on it and pip will keep installing it. No files go into a pydub/ folder. The package is one .pth file and one small import hook. pydub2 is only imported when something imports pydub.

To turn it off set PYDUB2_COMPAT=0 in the environment, or pip uninstall pydub2-compat. If pydub2 fails to import you get a one line warning and the real pydub is used.

Things to know:

  • It needs the .pth file to be read, so it does not work with python -S. With pip install --user it does not work under python -I. Normal installs and venvs are fine.
  • pip list and importlib.metadata.version("pydub") still report the real pydub if it is installed.
  • Without the real pydub, importlib.metadata.version("pydub") raises PackageNotFoundError and pip show pydub finds nothing.
  • pip does not know that this stands in for pydub. A package that requires pydub makes pip install the real pydub, and pip check complains about it while only pydub2-compat is installed.
  • When the real pydub is installed too, import pydub still gives pydub2, because the hook runs before the normal lookup. The real pydub is used when pydub2 cannot be imported or PYDUB2_COMPAT=0 is set.
  • importlib.util.find_spec("pydub") imports pydub2 to see that it works.
  • A pickle written by pydub loads as a pydub2 AudioSegment. A pickle written by pydub2 names pydub2 and the real pydub cannot read it.
  • pydub.pyaudioop and pydub.audioop do not exist and raise ImportError, because pydub2 does not need audioop.
  • python -m pydub.utils and the like stop with "No code object available".
  • Do not run tests that compare against pydub with this installed, they would test pydub2 against itself.

MIT, see LICENSE. The project is at github.com/rs-jensen/pydub2.

Metadata

Release files for pydub2-compat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pydub2-compat 0.1.0
File Interpreter ABI Platform Actions
pydub2_compat-0.1.0-py3-none-any.whl Python 3 none any Details for pydub2_compat-0.1.0-py3-none-any.whl

Release files / pydub2_compat-0.1.0-py3-none-any.whl

Download URL pydub2_compat-0.1.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d48a88fddd8ffbd8d5534aff290d74d66505d86032ab6fbb93d7a35e3f4deed
BLAKE2b-256 checksum
How to use checksums
b4648ec2cfa58bc450b6ee053bde96f2f5582d0afcb453052e70cd44787e1438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for pydub2-compat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for pydub2_compat-0.1.0-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page