I am deploying a Flask + Dash application to AWS Elastic BeanStalk environment. I generated the requirements.txt
using pip freeze
command. When I deploy the application, I run into ModuleNotFound Error
. I have sagemaker
in requirements.txt
.
Here's the traceback from the logs:
File "/var/app/current/calc.py", line 11, in <module>
Dec 31 23:15:51 ip-172-31-30-95 web: from sagemaker.serializers import CSVSerializer
Dec 31 23:15:51 ip-172-31-30-95 web: ModuleNotFoundError: No module named 'sagemaker'
Dec 31 23:15:51 ip-172-31-30-95 web: [2021-12-31 23:15:51 +0000] [10214] [INFO] Worker exiting (pid: 10214)
Dec 31 23:15:52 ip-172-31-30-95 web: [2021-12-31 23:15:52 +0000] [10062] [CRITICAL] WORKER TIMEOUT (pid:10214)
Dec 31 23:15:52 ip-172-31-30-95 web: [2021-12-31 23:15:52 +0000] [10062] [WARNING] Worker with pid 10214 was terminated due to signal 6
Dec 31 23:15:52 ip-172-31-30-95 web: [2021-12-31 23:15:52 +0000] [10220] [INFO] Booting worker with pid: 10220
Dec 31 23:16:22 ip-172-31-30-95 web: [2021-12-31 23:16:22 +0000] [10062] [CRITICAL] WORKER TIMEOUT (pid:10220)
Dec 31 23:16:22 ip-172-31-30-95 web: [2021-12-31 23:16:22 +0000] [10220] [INFO] Worker exiting (pid: 10220)
I would just comment, but I can't yet.
If you generated requirements.txt with pip freeze then all of the packages would have versions. Did you remove the version, or take the output of pip freeze and copy and past it into a file? Try pip freeze > requirements.txt
to create a requirements file where all the packages have specific versions and see if that works.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.