簡體   English   中英

Heroku 推送找不到 Django 3.2.8

[英]Heroku push can't find Django 3.2.8

將我的 git 存儲庫推送到 heroku 時,它失敗並出現以下錯誤:

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> No Python version was specified. Using the same version as the last build: python-3.9.7
remote:        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Requirements file has been changed, clearing cached dependencies
remote: -----> Installing python-3.9.7
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting Gunicorn==20.1.0
remote:          Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
remote:        Collecting Jinja2==2.11.2
remote:          Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
remote:        Collecting Django-Heroku==0.3.1
remote:          Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote:        ERROR: Could not find a version that satisfies the requirement Django-3.2.8 (from -r /tmp/build_43fa9180/requirements.txt (line 4)) (from versions: none)
remote:        ERROR: No matching distribution found for Django-3.2.8 (from -r /tmp/build_43fa9180/requirements.txt (line 4))
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 262a4549043aa448dc2000c886cad672f979d8f0
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 262a4549043aa448dc2000c886cad672f979d8f0
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to shrouded-bastion-04661.
remote:
To https://git.heroku.com/shrouded-bastion-04661.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shrouded-bastion-04661.git'

它使用與 django 3.2.8 兼容的 python 3.9.7。 奇怪的是,一切都很好,直到我按照本教程使用 Azure 托管靜態文件https://medium.com/@DawlysD/django-using-azure-blob-storage-to-handle-static-media-assets -from-scratch-90cbbc7d56be

從那時起,我不得不安裝 PostgreSQL 和 Visual Studio 才能讓 pg_config 文件正常工作。

編輯:這是requirements.txt:

Gunicorn==20.1.0
Jinja2==2.11.2
Django-Heroku==0.3.1
Django-3.2.8
asgiref-3.4.1
azure-core-1.19.0
azure-storage-blob-12.9.0
certifi-2021.10.8
cffi-1.15.0
charset-normalizer-2.0.7
cryptography-35.0.0
django-storages-1.12.2
idna-3.3
isodate-0.6.0
msrest-0.6.21
oauthlib-3.1.1
pycparser-2.20
pytz-2021.3
requests-2.26.0
requests-oauthlib-1.3.0
six-1.16.0
sqlparse-0.4.2
urllib3-1.26.7

-版本說明符中無效。

格式為package-version所有依賴package-version需要更改為package==version

例如,改變

Django-3.2.8

Django==3.2.8

azure-storage-blob-12.9.0

azure-storage-blob==12.9.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM