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.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
JohnW
  • 9
  • 3

2 Answers2

1

Usually, rolling back to an older version of playsound helps. You can do this by typing the following in the command prompt:

pip install playsound==1.2.2 
                                                  

Here, 1.2.2 stands for the version of playsound to which you will be rolling back.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

All you need to do is downgrade your playsound to any other version.