Python Heroku构建失败并出现错误“;PyObjC要求MacOS构建如何修复?
我试图在一个非常简单的Django应用程序中使用playsound模块,并使用以下代码来播放mp3文件:Python Heroku构建失败并出现错误“;PyObjC要求MacOS构建如何修复?,python,heroku,pyobjc,playsound,Python,Heroku,Pyobjc,Playsound,我试图在一个非常简单的Django应用程序中使用playsound模块,并使用以下代码来播放mp3文件: from playsound import playsound playsound(filename) 然而,我对Heroku的推动在PyOBjC失败了(这显然也是需要的)。我已经安装了playsound和PyObjC(没有PyObjC,我的游戏因为需要AppKit而失败)。安装了这两个模块后,该应用程序在我的本地服务器上运行良好 在Heroku建造之前,一切都很好。下面的
from playsound import playsound
playsound(filename)
然而,我对Heroku的推动在PyOBjC失败了(这显然也是需要的)。我已经安装了playsound和PyObjC(没有PyObjC,我的游戏因为需要AppKit而失败)。安装了这两个模块后,该应用程序在我的本地服务器上运行良好
在Heroku建造之前,一切都很好。下面的错误片段。有人知道我需要做什么才能让这个构建正常工作吗
提前非常感谢您的帮助
...
remote: Collecting pyobjc-core==6.1
remote: Downloading pyobjc-core-6.1.tar.gz (791 kB)
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l_hzqzmw/pyobjc-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l_hzqzmw/pyobjc-core/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-l_hzqzmw/pyobjc-core/pip-egg-info
remote: cwd: /tmp/pip-install-l_hzqzmw/pyobjc-core/
remote: Complete output (4 lines):
remote: /app/.heroku/python/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
remote: warnings.warn(msg)
remote: running egg_info
remote: error: PyObjC requires macOS to build
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to db-devsite.
remote:
To https://git.heroku.com/db-devsite.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/db-devsite.git'
playsound模块在macOS上使用时仅依赖于PyObjC,对于Linux机器(如Heroku),该库依赖于“PyGObject”和GStreamer库 请注意,playsound在运行代码的机器上播放声音,这可能不是您使用Heroku时想要的(它将尝试在Heroku上播放机器的声音)