简体   繁体   English

上传 Flask 应用程序时出现 AWS Elastic Beanstalk 错误

[英]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.

相关问题 尝试将Flask App部署到AWS Elastic Beanstalk时出错 - Error when Trying to Deploy Flask App to AWS Elastic Beanstalk 如何将烧瓶应用程序发送到 AWS Elastic Beanstalk? - How to send a flask application to AWS Elastic Beanstalk? Flask 应用程序未在 AWS elastic beanstalk 上部署 - Flask Application is not getting deployed at AWS elastic beanstalk AWS Elastic Beanstalk:构建节点应用程序时出错 - AWS Elastic Beanstalk: Error when building node application AWS Elastic Beanstalk 错误:无法部署应用程序 - AWS Elastic Beanstalk error: Failed to deploy application 无法在 AWS Elastic Beanstalk 上部署 Python Flask 应用程序 | 没有名为“应用程序”的模块 - Python Flask application not deployable on AWS Elastic Beanstalk | No module named 'application' WordPress和AWS-Elastic Beanstalk卡在“上传应用程序版本”中 - Wordpress and AWS - Elastic Beanstalk stuck in “Uploading application version” 如何使用弹性 beantalk 和 aws 修复 Flask 应用程序中的内部服务器错误 - How to fix internal server error in Flask application using elastic beanstalk and aws ModuleNotFoundError:在 AWS Elastic Beanstalk 上部署 Flask 应用程序时没有名为“应用程序”的模块 - ModuleNotFoundError: No module named 'application' when deploying Flask app on AWS Elastic Beanstalk 如何使用应用程序工厂将Flask应用程序部署到AWS Elastic beantalk - How to deploy Flask app to AWS Elastic beanstalk using an application factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM