更新:
2022.05.08我将"requirement.txt“改名为"requirements.txt”。但它不能解决我的问题。现在,新的错误信息是
2022/05/08 03:30:45.608563 [INFO] ERROR: Cannot install -r requirements.txt (line 1), -r requirements.txt (line 7) and botocore==1.23.24 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts这里有更多的信息
卫生事业:
ELB processes are not healthy on all instances.
None of the instances are sending data.
ELB health is failing or not available for all instances.前10行(需求文件),该文件由命令"pip冻结> requirements.txt“创建。
aiobotocore==2.1.1
aiohttp==3.8.1
aioitertools==0.10.0
aiosignal==1.2.0
async-timeout==4.0.2
attrs==21.4.0
boto3==1.21.10
botocore==1.23.24
certifi==2021.10.8
charset-normalizer==2.0.12因此,无法安装的软件包是:"aiobotocore“、"botocore”和"boto3“。
好像很有电啊。"boto3“是用于AWS的Python,为什么AWSElasticBean秸秆不能支持它?
我创建了一个可以从S3下载文件的烧瓶应用程序。它在我的本地PC上运行得很好,但是当我试图在AWS弹性豆柄上部署我的代码时,我遇到了“健康:严重”的问题。
我查了一下日志,发现:
May 8 01:28:48 ip-172-31-7-112 web: from flask import Flask, Response, render_template
May 8 01:28:48 ip-172-31-7-112 web: ModuleNotFoundError: No module named 'flask'
May 8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4977] [INFO] Worker exiting (pid: 4977)
May 8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4971] [INFO] Shutting down: Master
May 8 01:28:48 ip-172-31-7-112 web: [2022-05-08 01:28:48 +0000] [4971] [INFO] Reason: Worker failed to boot.
May 8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Starting gunicorn 20.1.0
May 8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Listening at: http://127.0.0.1:8000 (4985)
May 8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4985] [INFO] Using worker: gthread
May 8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4991] [INFO] Booting worker with pid: 4991
May 8 01:28:49 ip-172-31-7-112 web: [2022-05-08 01:28:49 +0000] [4991] [ERROR] Exception in worker process我确信我的应用程序文件被命名为"application.py“,应用程序也被命名为" application”
from flask import Flask, Response, render_template
from boto3 import client
application = Flask(__name__)
...
if __name__ == "__main__":
application.run(debug=True)我还检查了requirement.txt并找到了烧瓶信息
Flask==2.0.3
flask==2.0.3 # at first I think it is an uppercase/lowercase issue, so I add the 'flask==2.0.3'我的python.config文件:
option_settings:
"aws:elasticbeanstalk:container:python":
WSGIPath: application:application发布于 2022-05-08 17:55:16
我问了这个问题,现在我解决了,所以我想分享我是如何解决这个问题的。
首先,我试图通过调整包的版本来修复此错误,因为日志提供了有关此问题的更多详细信息,如下所示:
The conflict is caused by:
The user requested botocore==1.25.9
aiobotocore 2.3.1 depends on botocore<1.24.22 and >=1.24.21但是,它不起作用。每次我调整版本时,都会出现一个新的包依赖问题。
因此,我卸载了Pycharm上的所有软件包,并逐一安装,以确保我的应用程序能够在本地PC上运行。接下来,我通过命令创建一个新的“requirements.txt”文件
pip freeze > requirements.txt然后,我压缩所有需要的文件,并将我的应用程序部署到AWS上。它起作用了!健康状况还好。
https://stackoverflow.com/questions/72157517
复制相似问题