How to Install playsound in Python
Pure Python, cross platform, single function module with no dependencies for playing sounds.
pip install playsound
What is playsound?
Pure Python, cross platform, single function module with no dependencies for playing sounds.
Pure Python, cross platform, single function module with no dependencies for playing sounds.
If you insist on the (slightly) harder way of installing, from source, you know how to do it already and don't need my help.
The latest version of the source code can be found at:
Quick Start
Minimal example to get started with playsound:
import playsound
print(playsound.__version__)
Installation
pip (standard)
pip install playsound
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install playsound
pip3
pip3 install playsound
conda
conda install -c conda-forge playsound
Poetry
poetry add playsound
Verify the Installation
After installing, confirm the package is available:
python -c "import playsound; print(playsound.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing playsound with pip.
ModuleNotFoundError: No module named 'playsound'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install playsound. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'playsound' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install playsound to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'playsound'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show playsound and upgrade with pip install --upgrade playsound.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install playsound. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user playsound
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org playsound
Recent Releases
| Version | Released |
|---|---|
1.3.0 latest |
2021-07-24 |
1.2.2 |
2017-06-29 |
1.2.1 |
2016-02-28 |
1.2.0 |
2016-02-20 |
1.1.0 |
2016-01-27 |
Manage playsound
Upgrade to latest version
pip install --upgrade playsound
Install a specific version
pip install playsound==1.3.0
Uninstall
pip uninstall playsound
Check what is installed
pip show playsound