无法使用 pip 安装 Playsound

-2 python pip

我无法使用 pip 安装 Playsound。

\n
PS E:\\python> pip install playsound\nCollecting playsound\n  Using cached playsound-1.3.0.tar.gz (7.7 kB)\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... error\n  error: subprocess-exited-with-error\n  \n  \xc3\x97 Getting requirements to build wheel did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [29 lines of output]\n      Traceback (most recent call last):\n        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>\n          main()\n        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\n          json_out[\'return_val\'] = hook(**hook_input[\'kwargs\'])\n                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                        ^^^^^^^^^^^^^^^^^^^^^^        File "C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\inspect.py", line 1244, in getsourcelines\n          lines, lnum = findsource(object)\n                        ^^^^^^^^^^^^^^^^^^\n        File "C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\inspect.py", line 1081, in findsource          raise OSError(\'could not get source code\')\n      OSError: could not get source code\n      [end of output]\n\n  note: This error originates from a subprocess, and is likely not a problem with pip.\nerror: subprocess-exited-with-error\n\n\xc3\x97 Getting requirements to build wheel did not run successfully.\n\xe2\x94\x82 exit code: 1\n\xe2\x95\xb0\xe2\x94\x80> See above for output.\n\nnote: This error originates from a subprocess, and is likely not a problem with pip.\nPS E:\\python>\n
Run Code Online (Sandbox Code Playgroud)\n

小智 6

尝试安装/升级轮子:

pip install --upgrade wheel
Run Code Online (Sandbox Code Playgroud)

这对我有用。