Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
playsound error
#1
i got this error while installing playsound on Python 3.13

D:\Dan\AIEngine\Code\ComputerVisionTasks\ImageDataAugmentation\AudioAugmenatation>pip install playsound
Collecting playsound
  Using cached playsound-1.3.0.tar.gz (7.7 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      Traceback (most recent call last):
        File "C:\Program Files\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "C:\Program Files\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\Nabarupa\AppData\Local\Temp\pip-build-env-izvyz9ls\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nabarupa\AppData\Local\Temp\pip-build-env-izvyz9ls\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\Nabarupa\AppData\Local\Temp\pip-build-env-izvyz9ls\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Nabarupa\AppData\Local\Temp\pip-build-env-izvyz9ls\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 6, in <module>
        File "C:\Program Files\Python313\Lib\inspect.py", line 1256, in getsource
          lines, lnum = getsourcelines(object)
                        ~~~~~~~~~~~~~~^^^^^^^^
        File "C:\Program Files\Python313\Lib\inspect.py", line 1238, in getsourcelines
          lines, lnum = findsource(object)
                        ~~~~~~~~~~^^^^^^^^
        File "C:\Program Files\Python313\Lib\inspect.py", line 1078, in findsource
          raise OSError('could not get source code')
      OSError: could not get source code
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'playsound' when getting requirements to build wheel
Need help to solve this. Thanks in adv.
Dan
likes this post
Reply
#2
playsound (the original one) is unmaintained and its setup.py does some brittle introspection,
that breaks on newer Pythons, including 3.13.
Use playsound3

# pip uninstall -y playsound
E:\div_code\sci_env
(sci_env) λ uv pip install playsound3
Resolved 2 packages in 567ms
Prepared 2 packages in 2.19s
 + playsound3==3.2.8
 + pywin32==311

E:\div_code\sci_env
(sci_env) λ python
Python 3.13.3 (main, Apr  9 2025, 04:04:49) [MSC v.1943 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from playsound3 import playsound
>>>
buran and like this post
Reply
#3
@danandu: it's basically a similar problem to the one you had with NLTK. Just with the difference that NLTK doesn'r run at the time of writing these lines on Python 3.14, while playsound is unmaintained for years.

In case you bump into problems like this in the future, it's always a good idea to go to the Python Package Index at https://pypi.org and search there for the package you tried to install. In case of playsound (https://pypi.org/project/playsound/) you'll see that the last tested version is 3.9, a fairly old Python release. Which doesn't mean it doesn't work, but anything between "works just fine" and "doesn't work at all" may happen. Furthermore, you'll find on the pypi page typically a link to the repo of the project, in case of playsound https://github.com/TaylorSMarks/playsound . If the repo hasn't seen any commit for 1,5 years or more, it may strongly hint towards the the project is at least idle, if not unmaintained. Both indicate that you may want to longer for newer / better maintained Python modules.

Regards, noisefloor
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ERROR WHILE INSTALLING PLAYSOUND MODULE satwants33 2 10,594 Mar-23-2024, 12:50 PM
Last Post: Ritik2508
  GitHub, playsound install Qs/? tronic72 5 9,280 Nov-12-2023, 09:32 PM
Last Post: tronic72

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020