Python 如何在chromebook上使用playsound模块?
如何在python中使用Python 如何在chromebook上使用playsound模块?,python,pypi,playsound,Python,Pypi,Playsound,如何在python中使用playsound()? 这是我的密码: import time import playsound t = int(input("How many seconds do you want to set the timer for? ")) while t: mins = t // 60 secs = t % 60 timer = '{:02d}:{:02d}'.format(mins, secs) print(ti
playsound()
?
这是我的密码:
import time
import playsound
t = int(input("How many seconds do you want to set the timer for? "))
while t:
mins = t // 60
secs = t % 60
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1)
t -=1
playsound.playsound("beep-05.mp3")
错误消息是:
Traceback (most recent call last):
File "/home/ubuntu/test.py", line 14, in <module>
playsound.playsound("beep-05.mp3")
File "/home/ubuntu/.local/lib/python3.9/site-packages/playsound.py", line 91, in _playsoundNix
import gi
ModuleNotFoundError: No module named 'gi'
回溯(最近一次呼叫最后一次):
文件“/home/ubuntu/test.py”,第14行,在
播放声音。播放声音(“嘟嘟-05.mp3”)
文件“/home/ubuntu/.local/lib/python3.9/site packages/playsound.py”,第91行,在playsoundNix中
导入gi
ModuleNotFoundError:没有名为“gi”的模块
:“在Linux上,使用GStreamer”。您需要安装并安装。不知道是哪个版本<代码>播放声音相当老(5年)。