即使语法与官方网站上的相同,此 Playsound 模块的代码中存在什么错误?

1 python python-playsound

我也检查了路径变量,其他函数一切正常,但仅显示此模块的错误。代码:

from playsound import playsound
playsound('E://PYTHON//Music.mp3')
Run Code Online (Sandbox Code Playgroud)

以下是错误:

PS C:\Users\HP> & C:/Users/HP/AppData/Local/Programs/Python/Python39/python.exe e:/PYTHON/Playsound.py

    Error 263 for command:
        open E://PYTHON//Music.mp3
    The specified device is not open or is not recognized by MCI.

    Error 263 for command:
        close E://PYTHON//Music.mp3
Failed to close the file: E://PYTHON//Music.mp3
Traceback (most recent call last):
  File "e:\PYTHON\Playsound.py", line 2, in <module>
    playsound('E://PYTHON//Music.mp3')
  File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 72, in _playsoundWin
    winCommand(u'open {}'.format(sound))
  File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 64, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 263 for command:
        open E://PYTHON//Music.mp3
    The specified device is not open or is not recognized by MCI.
PS C:\Users\HP> & C:/Users/HP/AppData/Local/Programs/Python/Python39/python.exe e:/PYTHON/Playsound.py

    Error 263 for command:
        open E://PYTHON//Music.mp3
    The specified device is not open or is not recognized by MCI.

    Error 263 for command:
        close E://PYTHON//Music.mp3
    The specified device is not open or is not recognized by MCI.
Failed to close the file: E://PYTHON//Music.mp3
Traceback (most recent call last):
  File "e:\PYTHON\Playsound.py", line 2, in <module>
    playsound('E://PYTHON//Music.mp3')
  File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 72, in _playsoundWin
    winCommand(u'open {}'.format(sound))
  File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 64, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
    Error 263 for command:
        open E://PYTHON//Music.mp3
    The specified device is not open or is not recognized by MCI.
Run Code Online (Sandbox Code Playgroud)

小智 8

pip install Playsound==1.2.2

指定的设备未打开或未被 MCI 识别 - Playsound 1.3.0