Python Forum

Full Version: ERROR WHILE INSTALLING PLAYSOUND MODULE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone,

I hope you all are good.

I am new to python world and facing some issue while installing play sound.Error below :

PS C:\Users\Dell\3D Objects> pip install playsound
Defaulting to user installation because normal site-packages is not writeable
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
╰─> [28 lines of output]
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\Dell\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Dell\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Dell\AppData\Local\Temp\pip-build-env-hc4hptab\overlay\Lib\site-packages\setuptools\build_meta.py", line
325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Dell\AppData\Local\Temp\pip-build-env-hc4hptab\overlay\Lib\site-packages\setuptools\build_meta.py", line
295, in _get_build_requires
self.run_setup()
File "C:\Users\Dell\AppData\Local\Temp\pip-build-env-hc4hptab\overlay\Lib\site-packages\setuptools\build_meta.py", line
480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\Dell\AppData\Local\Temp\pip-build-env-hc4hptab\overlay\Lib\site-packages\setuptools\build_meta.py", line
311, in run_setup
exec(code, locals())
File "<string>", line 6, in <module>
File "C:\Program Files\Python312\Lib\inspect.py", line 1282, in getsource
lines, lnum = getsourcelines(object)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\inspect.py", line 1264, in getsourcelines
lines, lnum = findsource(object)
^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\inspect.py", line 1093, 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: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
I went to the package website and looked under "issues". Looks like there is a workaround for now.

https://github.com/TaylorSMarks/playsound/issues/150

Quote:pip install playsound@git+https://github.com/taconi/playsound
This command can be used temporarily for installing the package tho.
pip install wheel
pip install playsound
this fixed the issue for me