Search code examples
djangopiprequirements.txtwinsound

ModuleNotFoundError at /admin No module named 'winsound'


I am developing an app in Django.

My app plays a sound using winsound module.

import sys
import winsound

duration = 150  # milliseconds
    freq = 440  # Hz
    winsound.Beep(freq, duration)
    winsound.Beep(freq, duration)
    winsound.Beep(freq, duration)

It worked fine as soon as I was developing in local, but when I pushed the app to heroku and then tryed to access the admin section, the web returned the error

ModuleNotFoundError at /admin

No module named 'winsound'

So I tryed to pip install windsound , but apparently there is no module having such name available for download.

Thinking that the module was maybe already installed but with another name, I also tried

pip freeze>requirements.txt

and added 'winsound' in INSTALLED_APPS, but nothing worked.

On the web I can find little information on winsound module and it appears it is not available to pip install with python... Does anybody knows how to solve it?


Solution

  • The problem is that the operating system of heroku is linux, and winsound is only for Windows; So it won't be installed on heroku.