gpt4 book ai didi

python - Heroku 部署失败 : pip. _vendor.packaging.requirements.InvalidRequirement : Invalid requirement, "' 版本解析错误'"

转载 作者:行者123 更新时间:2023-12-01 09:24:09 40 4
gpt4 key购买 nike

不确定为什么我的 herokuapp 部署失败。我正在 python 3.6.5 上构建一个 Flask 应用程序。我的应用程序在本地服务器上运行得很好。两个月前,该应用程序在 python 3.6.4 上正确部署,但收到升级到 3.6.5 的警告。在 3.6.4 和 3.6.5 下,我的应用程序因此错误而崩溃。这是 heroku-18 堆栈的错误吗?我查看了https://github.com/heroku/heroku-buildpack-python/issues/680但不知道它对我有什么帮助。我真的很感激一些帮助。谢谢!

Counting objects: 14, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (14/14), 1.69 KiB | 1.69 MiB/s, done.
Total 14 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.5
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Invalid requirement: 'Package Version'
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 92, in __init__
remote: req = REQUIREMENT.parseString(requirement_string)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1617, in parseString
remote: raise exc
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1607, in parseString
remote: loc, tokens = self._parse( instring, 0 )
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1379, in _parseNoCache
remote: loc,tokens = self.parseImpl( instring, preloc, doActions )
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3376, in parseImpl
remote: loc, exprtokens = e._parse( instring, loc, doActions )
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 1383, in _parseNoCache
remote: loc,tokens = self.parseImpl( instring, preloc, doActions )
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/pyparsing.py", line 3164, in parseImpl
remote: raise ParseException(instring, loc, self.errmsg, self)
remote: pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 17), (line:1, col:18)
remote:
remote: During handling of the above exception, another exception occurred:
remote:
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/req_install.py", line 82, in __init__
remote: req = Requirement(req)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
remote: requirement_string[e.loc:e.loc + 8]))
remote: pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'Version'"
remote:
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to weborg.

需求.txt:

Package          Version
---------------- -------
alembic 0.9.9
click 6.7
Flask 1.0.2
Flask-Admin 1.5.1
Flask-Login 0.4.1
Flask-Migrate 2.1.1
Flask-SQLAlchemy 2.3.2
Flask-Uploads 0.2.1
Flask-WTF 0.14.2
gunicorn 19.8.1
itsdangerous 0.24
Jinja2 2.10
Mako 1.0.7
MarkupSafe 1.0
phonenumbers 8.9.6
pip 10.0.1
psycopg2 2.7.4
python-dateutil 2.7.3
python-editor 1.0.3
setuptools 39.2.0
six 1.11.0
SQLAlchemy 1.2.8
Werkzeug 0.14.1
wheel 0.31.1
WTForms 2.1

运行时.txt

python-3.6.5

进程文件

web: flask db upgrade; flask translate compile; gunicorn webapp:app

最佳答案

您的requirements.txt 格式不正确。

在我看来,您是使用pip list生成的。您希望在生成 requirements.txt 时使用 pip freeze

关于python - Heroku 部署失败 : pip. _vendor.packaging.requirements.InvalidRequirement : Invalid requirement, "' 版本解析错误'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50575113/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com