ModuleNotFoundError at /admin No module named 'winsound'

冷暖自知 提交于 2019-12-13 02:55:59

问题


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 moduled named so 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?


回答1:


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.



来源:https://stackoverflow.com/questions/59047909/modulenotfounderror-at-admin-no-module-named-winsound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!