简体   繁体   English

尝试将Flask App部署到AWS Elastic Beanstalk时出错

[英]Error when Trying to Deploy Flask App to AWS Elastic Beanstalk

I am trying to deploy a Flask application using AWS Elastic Beanstalk and unfortunately have run into the following error. 我正在尝试使用AWS Elastic Beanstalk部署Flask应用程序,不幸的是遇到了以下错误。 What confuses me is that the current version of pip in my virtual environment and local machine is 9.0.1, so I am not sure why it is picking up 7.1.2. 令我感到困惑的是,我的虚拟环境和本地计算机中的pip当前版本为9.0.1,所以我不确定为什么它采用了7.1.2。

Command "/opt/python/run/venv/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-L32BGc/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nO55i_-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-L32BGc/cffi
  You are using pip version 7.1.2, however version 9.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2017-01-29 15:42:34,743 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 541, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

This is because the pip version is too old. 这是因为pip版本太旧。 you can add .ebextensions to solve this. 您可以添加.ebextensions解决此问题。

  1. add .ebextensions folder in the root folder of your app 在您应用的根文件夹中添加.ebextensions文件夹
  2. put a pip.config file inside it, the content is : 在其中放一个pip.config文件,内容是:

commands:
  update_pip:
  command: "/opt/python/run/venv/bin/pip install --upgrade pip"
  1. run eb deploy again, it will be resolved. 再次运行eb deploy,它将得到解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试将 Flask 应用程序部署到 AWS Elastic Beanstalk 时,我不断收到“ModuleNotFoundError: No module named 'app'”错误消息 - When trying to deploy a Flask app to AWS Elastic Beanstalk, I keep getting the "ModuleNotFoundError: No module named 'app'" error message 我试图在 AWS 弹性豆茎上部署 flask 应用程序,但收到此错误 - I was trying to deploy a flask app on AWS elastic beanstalk, but am getting this error 如何使用应用程序工厂将Flask应用程序部署到AWS Elastic beantalk - How to deploy Flask app to AWS Elastic beanstalk using an application factory 如何在AWS弹性beanstalk上部署结构化Flask应用程序 - How to deploy structured Flask app on AWS elastic beanstalk 尝试部署Flask应用程序时,从beantalk中获取错误:“没有名为flask的模块” - Getting error from beanstalk when trying to deploy flask app: “no module named flask” ImportError - 将Falcon应用程序部署到AWS Elastic Beanstalk - ImportError - deploy Falcon app to AWS Elastic Beanstalk 在 AWS Elastic Beanstalk 中部署 Flask 应用程序 - Deploying Flask App in AWS Elastic Beanstalk AWS Elastic Beanstalk 错误我无法部署 - AWS Elastic Beanstalk error I cannot deploy 如何将 Visual Studio Flask 应用程序部署到 Elastic Beanstalk - How to deploy Visual Studio Flask app to Elastic Beanstalk 使用 AWS Elastic Beanstalk 托管 Django 应用程序时出错 - Error in hosting Django app with AWS Elastic Beanstalk
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM