Hello!
I would like to use module playsound, but it can not be loaded. I’m running python3.12on Ubuntu 24.04.3.
If I try to install this module with pip install playsound, I get:
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
There is no python3-playsound in Ubuntu apt package manager. pipx install playsound produces:
...
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
and also
error: subprocess-exited-with-error
OSError: could not get source code
I installed python3-wheeland also python3-full, but with no effect.
If I try to create a venv and from inside the venv I run pip install playsound I get the error
...
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I also tried with module playsound3, which can be installed with pip inside a venv, but when I run the script using playsound from the root directory of the venv, it prints
ModuleNotFoundError: No module named 'playsound3
What could it be the problem? I can either use playsound or playsound3.