0

I am trying to set up my Raspberry Pi Zero to play a sound through a pimoroni audio board. I am trying to use playsound but keep getting the message "Import Error: cannot import name 'playsound' from 'playsound'". My program is a simple one using Python 3.7.3:

from playsound import playsound

playsound('file.mp3')

As suggested in a similar post, I have deleted Python 2.7 and loaded (reloaded) Python 3.7.3. I have tried uninstalling playsound and have loaded playsound using pip3. Pip3 list tells me I have playsound 1.2.2 loaded. I do not know what else to try.

4

2 回答 2

0

您需要做的就是将您的播放声音降级到任何其他版本。

于 2022-03-06T01:16:14.613 回答
0

通常,回滚到旧版本的 playsound 会有所帮助。您可以通过在命令提示符中键入以下内容来执行此操作:

pip install playsound==1.2.2 
                                                  

在这里,1.2.2 代表您将回滚到的 playsound 版本。

于 2021-12-04T14:03:25.917 回答