python - 如何在 Heroku 服务器中安装 django-auth-ldap==1.2.7?

标签 python django heroku ldap django-auth-ldap

我正在尝试使用 requirements.txt 中的 pip install 安装此库django-auth-ldap==1.2.7

我正在使用 Heroku 服务进行部署。

但是,每次我尝试推送/部署代码时,我都无法完全完成依赖项检查/安装,因为会弹出此错误:

remote:        Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or
directory

我休养了这个问题和答案:python-ldap failed to install in Heroku

但是运气不佳

基本上,我尝试使用第三方BUILDPACK:

heroku config:set BUILDPACK_URL=https://github.com/damgad/heroku-buildpack-python-ldap.git

还有

heroku buildpacks:set https://github.com/damgad/heroku-buildpack-python-ldap.git

但仍然无法工作。

有人可以吗

  1. 帮助我展示一种构建自己的BUILDPACK
  2. 的方法
  3. 为我提供替代解决方案吗?

谢谢!

---编辑----

刚刚发现一些人正在努力使其发挥作用。

有一个拉取请求试图直接在heroku default buildpack中解决我的这个问题。

https://github.com/heroku/heroku-buildpack-python/pull/271

我会保持这个问题的开放性和更新,以防有人有同样的疑问。

谢谢!

最佳答案

这不是使用自定义构建包的方式;您所做的只是设置一个名为 BUILDPACK_URL 的环境变量。

相反,请遵循 documentation :您需要 heroku buildpacks:set https://.....

关于python - 如何在 Heroku 服务器中安装 django-auth-ldap==1.2.7?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35606309/

相关文章:

python - 我在哪里放置 python 库文件夹?

jquery - 使用 FormData 与 form.serialize() 与 django 进行 ajax 发帖

Django url 模板标签 : 'module' object has no attribute 'views'

python - Django ·赫罗库 : No Such File or Directory for image (image is in repo)

python - 使用 Pyinstaller 编译 Gekko

python - 在Python中读取SPSS(.sav)文件时出现 "title already used as a name or title"错误

python - 如何从 python 中的列表列表中获取 n 个最大的列表

python - 错误日期时间字段输入格式

ruby - 无法使用 Ruby 连接到 Heroku 上的 PostgreSQL 数据库 - 无法转换主机名

spring - Heroku 应用程序拒绝启动,因为它无法加载 kotlin.jvm.internal.Intrinsics