首页 > 解决方案 > Elastic Beanstalk is not installing requirements.txt file

问题描述

My current directory structure is like this,

/site
 - .elasticbeanstalk
 - static
 - templates
 - views
 - application.py
 - requirements.txt

To create my website I am using flask which I have installed. When I upload my project to Elastic Beanstalk I get the following error:

[Wed Aug 01 17:56:30.174032 2018] [:error] [pid 313] [remote 172.31.19.50:124] Traceback (most recent call last):
[Wed Aug 01 17:56:30.174051 2018] [:error] [pid 313] [remote 172.31.19.50:124] File "/opt/python/current/app/application.py", line 1, in <module>
[Wed Aug 01 17:56:30.174055 2018] [:error] [pid 313] [remote 172.31.19.50:124] from flask import Flask
[Wed Aug 01 17:56:30.174068 2018] [:error] [pid 313] [remote 172.31.19.50:124] ModuleNotFoundError: No module named 'flask'

My requirements.txt is in the root directory but for some reason flask is not being installed.

The contents of the requirements.txt file are:

click==6.7
Flask==1.0.2
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
Werkzeug==0.14.1

Any suggestions?

标签: pythonamazon-web-servicesflaskamazon-elastic-beanstalk

解决方案


推荐阅读