0

I'm unable to install playsound using pip.

PS E:\python> 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
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "C:\Users\Dell\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\Dell\AppData\Local\Programs\Python\Python311\Lib\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\Local\Programs\Python\Python311\Lib\inspect.py", line 1244, in getsourcelines
          lines, lnum = findsource(object)
                        ^^^^^^^^^^^^^^^^^^
        File "C:\Users\Dell\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 1081, 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.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS E:\python>
1
  • 1
    This appears to be a question about python on Windows, not Ubuntu Commented Apr 22, 2023 at 12:45

2 Answers 2

6

Try installing/upgrading wheel:

pip install --upgrade wheel

This worked for me.

1

i was facing same issue. Try to exit and then re-enter then just do pip install wheel then pip install playsound

Sometimes, if you have already installed wheel, then pip uninstall heel then install it again, then install playsound

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .