[英]AWS Elastic Beanstalk error when uploading Flask application
I recently tried to upload a Flask application to AWS however I received an error stating:我最近尝试将 Flask 应用程序上传到 AWS,但收到一条错误消息:
Your requirements.txt is invalid.
您的 requirements.txt 无效。 Snapshot your logs for details.
快照您的日志以获取详细信息。
I uploaded a test application (which I found online) to the server which worked, however my own application does not.我上传了一个测试应用程序(我在网上找到的)到可以工作的服务器,但是我自己的应用程序没有。
This is what my requirements.txt files looks like:这是我的 requirements.txt 文件的样子:
awsebcli==3.4.5
blinker==1.3
cement==2.4.0
docker-py==1.1.0
dockerpty==0.3.4
docopt==0.6.2
Flask==0.10.1
Flask-Bcrypt==0.6.2
Flask-Mail==0.9.1
itsdangerous==0.24
Jinja2==2.7.3
jmespath==0.7.1
MarkupSafe==0.23
mercurial==3.2.4
pathspec==0.3.3
pbr==1.1.1
plyer==1.2.1
pycrypto==2.6.1
python-bcrypt==0.3.1
python-dateutil==2.4.2
PyYAML==3.11
requests==2.6.2
schedule==0.3.1
six==1.9.0
stevedore==1.5.0
texttable==0.8.3
virtualenv==12.0.4
virtualenv-clone==0.2.5
virtualenvwrapper==4.6.0
websocket-client==0.32.0
Werkzeug==0.10.1
wxPython-common==3.0.2.0
I have no idea what is wrong with it.我不知道它有什么问题。 I have not manually changed it or added anything strange.
我没有手动更改它或添加任何奇怪的东西。 I only used
pip freeze > requirements.txt
to build it.我只使用
pip freeze > requirements.txt
来构建它。
How do I solve this issue?我该如何解决这个问题? Thanks.
谢谢。
Edit编辑
These are my system packages:这些是我的系统包:
awsebcli (3.4.5)
blinker (1.3)
cement (2.4.0)
docker-py (1.1.0)
dockerpty (0.3.4)
docopt (0.6.2)
Flask (0.10.1)
Flask-Bcrypt (0.6.2)
Flask-Mail (0.9.1)
itsdangerous (0.24)
Jinja2 (2.7.3)
jmespath (0.7.1)
MarkupSafe (0.23)
mercurial (3.2.4)
pathspec (0.3.3)
pbr (1.1.1)
pip (6.0.3)
plyer (1.2.1)
pycrypto (2.6.1)
python-bcrypt (0.3.1)
python-dateutil (2.4.2)
PyYAML (3.11)
requests (2.6.2)
schedule (0.3.1)
setuptools (7.0)
six (1.9.0)
stevedore (1.5.0)
texttable (0.8.3)
virtualenv (12.0.4)
virtualenv-clone (0.2.5)
virtualenvwrapper (4.6.0)
websocket-client (0.32.0)
Werkzeug (0.10.1)
Just copy-pasted and installed the code.只需复制粘贴并安装代码。
wxPython-common doesn't seem to have that version available in pip. wxPython-common 在 pip 中似乎没有那个版本。
Other than that, there doesn't seem to be any issue.除此之外,似乎没有任何问题。 Just make sure the requirements.txt file don't have any other characters at the beginning or end of the file
只需确保 requirements.txt 文件的开头或结尾没有任何其他字符
There are a lot of system packages that are mentioned here.这里提到了很多系统包。 If you want to list only the files required for your project, then create a virtual environment using the command
如果只想列出项目所需的文件,则使用命令创建一个虚拟环境
virtualenv --no-site-packages virt
then use your virtual environment and manually install the required libraries for your python project using pip or pip3 install.然后使用您的虚拟环境并使用 pip 或 pip3 install 为您的 python 项目手动安装所需的库。
source virt/bin/activate // Use this to enter your virtual env
After that just use the code之后只需使用代码
pip3 freeze --local > requirements.txt
To save the requirements for uploading.保存上传要求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.