gpt4 book ai didi

python - python中的"Unknown problem while loading the specified device driver."错误

转载 作者:行者123 更新时间:2023-12-04 04:13:13 28 4
gpt4 key购买 nike

我正在使用 playsound 模块制作一个简单的娱乐程序。这是我的代码:

from playsound import playsound

print("please wait")
playsound("scan.wav")
和错误信息:
Traceback (most recent call last):
File "D:\Programi\python\lab\lab.py", line 9, in <module>
playsound("scan.wav")
File "C:\Users\ONT Studios\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\playsound.py", line 35, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
File "C:\Users\ONT Studios\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\playsound.py", line 31, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 266 for command:
open "scan.wav" alias playsound_0.98994089730741
Unknown problem while loading the specified device driver.
这是我的路径: D:\Programi\python\lab带文件: lab.py , scan.mp3 , 和 scan.wav .
我试过 this ,但没有成功。

最佳答案

我今天面临同样的问题,我能够以一种方式解决它。这可能是一个错误,但您可以绕过它。所以基本上当连续导入几个模块时,这会产生错误。我所做的是首先导入 playsound 模块,然后播放一个声音并打印一堆随机的东西,然后导入其余的模块。这解决了我的问题。

import mouse
from playsound import playsound

playsound('D:/rakkiz.mp3')
print("\n")
print("\n")
print("\n")
print("\n")

import re
import pywinauto
import time
import keyboard

关于python - python中的"Unknown problem while loading the specified device driver."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61300921/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com