【发布时间】:2021-12-20 13:21:53
【问题描述】:
这是我在尝试推送时遇到的错误,一周前一切正常,我可以毫无问题地部署。现在,当我尝试部署时,我总是得到这个错误,因为我不能同时满足 python-dateutil==2.8(应用程序需要)和 python-dateutl==1.5(heroku 需要)。 不知道为什么会这样。 (在全球范围内更新了heroku,但没有任何改变)。 有一个包装器Heroku3 但我似乎无法使用它来部署,当我将它安装在 env 中时,heroku3 命令不存在并且它在 npm 上不可用,所以我所能做的就是编写 python 代码它。 如果有人知道如何解决此问题,将不胜感激。
git push heroku master
Enumerating objects: 401, done.
Counting objects: 100% (401/401), done.
Delta compression using up to 16 threads
Compressing objects: 100% (321/321), done.
Writing objects: 100% (386/386), 226.01 KiB | 4.43 MiB/s, done.
Total 386 (delta 39), reused 0 (delta 0), pack-reused 0
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: -----> No change in requirements detected, installing from cache
remote: -----> Using cached install of python-3.9.7
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: INFO: pip is looking at multiple versions of gunicorn to determine which version is compatible with other requirements. This could take a while.
remote: Collecting gunicorn==20.1.0
remote: Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
remote: INFO: pip is looking at multiple versions of django-storages to determine which version is compatible with other requirements. This could take a while.
remote: Collecting django-storages==1.11.1
remote: Downloading django_storages-1.11.1-py3-none-any.whl (42 kB)
remote: INFO: pip is looking at multiple versions of django-heroku to determine which version is compatible with other requirements. This could take a while.
remote: Collecting django-heroku==0.3.1
remote: Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote: INFO: pip is looking at multiple versions of django-crispy-forms to determine which version is compatible with other requirements. This could take a while.
remote: Collecting django-crispy-forms==1.12.0
remote: Downloading django_crispy_forms-1.12.0-py3-none-any.whl (122 kB)
remote: INFO: pip is looking at multiple versions of django to determine which version is compatible with other requirements. This could take a while.
remote: Collecting Django==3.2.7
remote: Downloading Django-3.2.7-py3-none-any.whl (7.9 MB)
remote: INFO: pip is looking at multiple versions of dj-database-url to determine which version is compatible with other requirements. This could take a while.
remote: Collecting dj-database-url==0.5.0
remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote: INFO: pip is looking at multiple versions of charset-normalizer to determine which version is compatible with other requirements. This could take a while.
remote: Collecting charset-normalizer==2.0.4
remote: Downloading charset_normalizer-2.0.4-py3-none-any.whl (36 kB)
remote: INFO: pip is looking at multiple versions of certifi to determine which version is compatible with other requirements. This could take a while.
remote: Collecting certifi==2021.5.30
remote: Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
remote: INFO: pip is looking at multiple versions of botocore to determine which version is compatible with other requirements. This could take a while.
remote: Collecting botocore==1.21.39
remote: Downloading botocore-1.21.39-py3-none-any.whl (7.9 MB)
remote: INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
remote: INFO: pip is looking at multiple versions of boto3 to determine which version is compatible with other requirements. This could take a while.
remote: Collecting boto3==1.18.39
remote: Downloading boto3-1.18.39-py3-none-any.whl (131 kB)
remote: INFO: pip is looking at multiple versions of beautifulsoup4 to determine which version is compatible with other requirements. This could take a while.
remote: Collecting beautifulsoup4==4.9.3
remote: Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
remote: INFO: pip is looking at multiple versions of asgiref to determine which version is compatible with other requirements. This could take a while.
remote: Collecting asgiref==3.4.1
remote: Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)
remote: INFO: pip is looking at multiple versions of botocore to determine which version is compatible with other requirements. This could take a while.
remote: ERROR: Cannot install -r /tmp/build_414b410f/requirements.txt (line 4), heroku==0.1.4 and python-dateutil==2.8.2 because these package versions have conflicting dependencies.
remote:
remote: The conflict is caused by:
remote: The user requested python-dateutil==2.8.2
remote: botocore 1.21.39 depends on python-dateutil<3.0.0 and >=2.1
remote:
remote: To fix this you could try to:
remote: 1. loosen the range of package versions you've specified
remote: 2. remove package versions to allow pip attempt to solve the dependency conflict
remote:
remote: ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
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: 37f55b221f93a23b73486ebf55520365c1b5bcb8
remote: !
remote: ! We have detected that you have triggered a build from source code with version 37f55b221f93a23b73486ebf55520365c1b5bcb8
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 app.
remote:
To gitlink
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'gitlink'
当我做 pip freeze 时,我得到了这个
asgiref==3.4.1
beautifulsoup4==4.9.3
boto3==1.18.39
botocore==1.21.39
certifi==2021.5.30
charset-normalizer==2.0.4
click==8.0.1
colorama==0.4.4
dj-database-url==0.5.0
Django==3.2.7
django-click==2.3.0
django-crispy-forms==1.12.0
django-heroku==0.3.1
django-pg-copy==0.4.0
django-storages==1.11.1
gunicorn==20.1.0
heroku3==5.1.4
idna==3.2
jmespath==0.10.0
pep517==0.12.0
Pillow==8.3.2
postgres==3.0.0
postgres.client==0.4.6
psycopg2==2.9.1
psycopg2-binary==2.9.1
psycopg2-pool==1.1
PyOpenGL==3.1.5
python-dateutil==2.8.2
python-decouple==3.4
pytz==2021.1
requests==2.26.0
s3transfer==0.5.0
six==1.16.0
soupsieve==2.2.1
sqlparse==0.4.1
tomli==1.2.2
urllib3==1.26.6
whitenoise==5.3.0
【问题讨论】:
-
你能把 requirements.txt 或 pipfile 贴在这里吗??
-
可以不加任何版本的python-dateutil让pip自己选择