我在Heroku上的Python应用无法始终构建:

-----> Python app detected
 !     Python has released a security update! Please consider upgrading to python-3.6.8
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Found python-3.6.4, removing
-----> Installing python-3.6.7
-----> Installing pip
-----> Installing SQLite3
 !     Push rejected, failed to compile Python app.
 !     Push failed

这是一个在本地运行良好的Django应用程序。

python-3.6.7中指定的runtime.txt,我已经尝试了其他版本。

我的Procfile包含:

release: python <appname>/manage.py migrate
web: python <appname>/manage.py runserver 0.0.0.0:$PORT

我可能会使用gunicorn,但这与这里无关。构建日志似乎没有向我提供任何信息。
requirements.txt
chardet==3.0.4
Django==2.0.2
idna==2.6
pytz==2018.3
requests==2.18.4
urllib3==1.22
dj-database-url==0.5.0
setuptools==1.0.0

最佳答案

在您的app.json中尝试一下。虽然这是一个临时解决方案

"buildpacks": [
    {
      "url": "https://github.com/heroku/heroku-buildpack-python.git#remove-
              sqlite"
    },

关于python - 安装sqlite3时Heroku python应用无法构建,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56677029/

10-12 21:54
查看更多