部署到Heroku时退出代码1

wfveoks0  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(120)
-----> Installing requirements with pip
       Collecting Flask==0.8
         Downloading Flask-0.8.tar.gz (494 kB)
         Preparing metadata (setup.py): started
         Preparing metadata (setup.py): finished with status 'error'
         error: subprocess-exited-with-error
         
         × python setup.py egg_info did not run successfully.
         │ exit code: 1
         ╰─> [7 lines of output]
             Traceback (most recent call last):
               File "<string>", line 2, in <module>
               File "<pip-setuptools-caller>", line 34, in <module>
               File "/tmp/pip-install-b10vp26m/flask_796f31ca16564e4e937e606cfdff087d/setup.py", line 62
                 print "Audit requires PyFlakes installed in your system."""
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
             [end of output]
         
         note: This error originates from a subprocess, and is likely not a problem with pip.
       error: metadata-generation-failed
       
       × Encountered error while generating package metadata.
       ╰─> See above for output.
       
       note: This is an issue with the package mentioned above, not pip.
       hint: See above for details.
 !     Push rejected, failed to compile Python app.
 !     Push failed

我尝试将Discord Bot部署到Heroku以获得更多正常运行时间,但在Heroku应用程序上手动部署时出现此错误。
我的requirements.txt文件:

Flask==0.8
Jinja2==2.6
Werkzeug==0.8.3
certifi==0.0.8
chardet==1.0.1
distribute==0.6.24
gunicorn==0.14.2
requests==0.11.1
pyflakes==2.5.0

我是否遗漏了任何依赖项?这是正确的方法吗?我知道我遗漏了Pyflakes,但它在我的需求文件中,所以我不确定。

omqzjyyz

omqzjyyz1#

Flask 0.8已经有11年的历史了,是为Python的旧版本而设计的,你应该在你的需求中指定更新版本的包,例如Flask==2.2.2
您应该确保代码与最新版本兼容,并更新依赖项。

相关问题