如何安装丢失的heroku库?

如何安装丢失的heroku库?,heroku,Heroku,使用heroku create时发生此错误。我知道需要安装sasl库,但我不知道如何在heroku上安装,我知道只在localhost上安装 remote: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAP

使用heroku create时发生此错误。我知道需要安装sasl库,但我不知道如何在heroku上安装,我知道只在localhost上安装

remote:            gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.19 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/usr/include -I/app/.heroku/python/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
remote:            Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or directory
remote:             #include <sasl.h>
remote:                              ^
remote:            compilation terminated.
remote:            error: command 'gcc' failed with exit status 1
remote:            
remote:            ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Q1St2s/python-ldap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-he61Ck-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Q1St2s/python-ldap
remote: 
remote:  !     Push rejected, failed to compile Python app
remote: 
remote: Verifying deploy....
remote: 
remote: !   Push rejected to shielded-beyond-8167.
remote: 
To https://git.heroku.com/shielded-beyond-8167.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shielded-beyond-8167.git'
remote:gcc-pthread-fno严格别名-g-O2-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-fPIC-DHAVE_SASL-DHAVE_TLS-DHAVE_LIBLDAP_R-DHAVE_LIBLDAP_R-dldapdapmodule_VERSION=2.4.19-IModules-I/opt/openldap-RE24/include-I/usr/include/include/SASL-I/usr/usr/include-I/app/.heroku/python2.7-c Modules/LDAPObject.c-obuild/temp.linux-x86_64-2.7/Modules/LDAPObject.o
远程:Modules/LDAPObject.c:18:18:致命错误:sasl.h:没有这样的文件或目录
远程:#包括
远程:^
远程:编译已终止。
远程:错误:命令“gcc”失败,退出状态为1
远程:
远程:----------------------------------------
远程:命令“/app/.heroku/python/bin/python-c”导入setuptools,标记化__文件_u_='/tmp/pip-build-Q1St2s/pythonlap/setup.py';exec(compile(getattr(tokenize,'open',open)('uuuu file,'uuuu.).read().replace('\r\n','\n'),'uuuu file,'exec'))“install--record/tmp/pip-he61Ck-record/install-record.txt--外部管理的单一版本--compile”失败,错误代码为/tmp/pip-build-Q1St2s/python ldap中的1
远程:
遥控器:!推送被拒绝,未能编译Python应用程序
远程:
远程:正在验证部署。。。。
远程:
遥控器:!推送到屏蔽-beyond-8167。
远程:
到https://git.heroku.com/shielded-beyond-8167.git
! [远程拒绝]主机->主机(拒绝预接收挂钩)
错误:无法将某些引用推送到'https://git.heroku.com/shielded-beyond-8167.git'

看起来您正试图将python应用程序部署到Heroku。对于Heroku上的Python应用程序,需要在项目根目录中的
requirements.txt
文件中列出依赖项

例如,如果您正在运行一个需要
请求
库的项目,那么您需要定义一个
requirements.txt
文件,其中包含以下内容

requests==2.7.0
注意:您可以通过运行以下命令(通常)在笔记本电脑上自动创建requirements.txt文件:

$ pip freeze > requirements.txt
这将自动为您创建一个requirements.txt文件,其中包含所有依赖项=)


如果在创建requirements.txt文件后仍然存在问题,这意味着您可能正在尝试使用尚未安装在Heroku核心映像上的C头库——在这种情况下,您需要创建一个自定义构建包:

看起来您正在尝试将python应用程序部署到Heroku。对于Heroku上的Python应用程序,需要在项目根目录中的
requirements.txt
文件中列出依赖项

例如,如果您正在运行一个需要
请求
库的项目,那么您需要定义一个
requirements.txt
文件,其中包含以下内容

requests==2.7.0
注意:您可以通过运行以下命令(通常)在笔记本电脑上自动创建requirements.txt文件:

$ pip freeze > requirements.txt
这将自动为您创建一个requirements.txt文件,其中包含所有依赖项=)

如果在创建requirements.txt文件后仍然存在问题,则意味着您可能试图使用尚未安装在Heroku core映像上的C头库——在这种情况下,您需要创建一个自定义构建包: