如何通过Cli安装PYAudio python pakage在heroku上。

问题描述 投票:0回答:1

如何通过heroku cli在heroku上安装pyaudio,如果我在heroku cli上使用 "pip install pyaudio "命令,会出现以下错误。

错误:收集pyaudio下载 https:/files.pythonhosted.orgpackagesab42b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6bPyAudio-0.2.11.tar.gz。为收集的包建立轮子:pyaudio 运行setup.py bdist_wheel for pyaudio......。- 错误 命令app.herokupythonbinpython -u -c "import setuptools, tokenize;文件='tmppip-build-vz9795aypyaudiosetup.py';f=getattr(tokenize, 'open', open)(档案);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 档案, 'exec'))" bdist_wheel -d tmptmpmq8ff3y9pip-wheel- -python-tag cp36: running bdist_wheel running build running build_py creating buildlib.linux-x86_64-3.6 copying srcpyaudio.py -> buildlib.linux-x86_64-3.6 running build_ext building '_portaudio' extension creating buildtemp. linux-x86_64-3.6 创建 buildtemp.linux-x86_64-3.6src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iapp. herokupythonincludepython3.6m -c src_portaudiomodule.c -o buildtemp.linux-x86_64-3.6src_portaudiomodule.o src_portaudiomodule.c:27:10: fatal error: stdio.h: 错误:命令'gcc'失败,退出状态为1。


为 pyaudio 创建轮子失败 为 pyaudio 运行 setup.py 清理失败为 pyaudio 创建 pyaudio 安装收集的包:pyaudio 运行 setup.py 安装 pyaudio ... - 错误 命令 app.herokupythonbinpython -u -c "import setuptools, tokenize;文件='tmppip-build-vz9795aypyaudiosetup.py';f=getattr(tokenize, 'open', open)(档案);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 档案, 'exec'))" install --record tmppip-gdj2okkn-recordinstall-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build create buildlib.linux-x86_64-3.6 copying srcpyaudio.py -> buildlib.linux-x86_64-3.6 running build_ext building '_portaudio' extension creating buildtemp.linux-x86_64-3.6src gcc -pthread -Wno-unused-result -Wsign-compare -Discovery. linux-x86_64-3.6 创建 buildtemp.linux-x86_64-3.6src gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iapp. herokupythonincludepython3.6m -c src_portaudiomodule.c -o buildtemp.linux-x86_64-3.6src_portaudiomodule.o src_portaudiomodule.c:27:10: fatal error: stdio.h: 错误:命令'gcc'失败,退出状态为1。

----------------------------------------

命令 "app.herokupythonbinpython -u -c "import setuptools, tokenize;文件='tmppip-build-vz9795aypyaudiosetup.py';f=getattr(tokenize, 'open', open)(档案);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 档案在tmppip-build-vz9795aypyaudio中,"安装--记录tmppip-gdj2okkn-recordinstall-record.txt--单一版本--外部管理--编译 "失败,错误代码为1你使用的是pip 9.0.2版本,但是19.3.1版本是可用的,你应该考虑通过 "pip安装--升级pip "命令升级。

heroku heroku-cli
1个回答
0
投票

你需要安装 heroku buildpacks:add --index 1 heroku-community/apt 的文件,然后在其中加入一个名为 Aptfile 在您的项目根目录下,然后将 portaudio19-dev python-all-dev 里面 Aptfile 文件,最后,你需要进行提交,并运行命令 git push heroku master

你可以在这里看到更多信息。https:/github.comherokuheroku-buildpack-apt。

© www.soinside.com 2019 - 2024. All rights reserved.