AWS Elastic Beanstalk - python - requirements.txt无效

时间:2017-06-19 11:43:18

标签: python amazon-web-services flask elastic-beanstalk

我正在关注AWS Elastic Beanstalk的Flask教程来部署我的应用程序。 虽然我收到错误您的requirements.txt无效 - 完整如下。我自己不写需求文件,我通过pip freeze命令生成它。

当我使用scipy.optimize模块时,问题似乎发生了。但是,脚本在我的本地服务器上运行没有任何问题。

注意:我是mac用户。

这是我的错误代码:

ERROR: Your requirements.txt is invalid. Snapshot your logs for details.
ERROR: [Instance: i-03702ea3033581434] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
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. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].

这是我的requirements.txt文件:

Flask==0.10.1
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
numpy==1.13.0
scipy==0.19.0
Werkzeug==0.12.2

这是我的eb日志:

  ----------------------------------------
  Command "/opt/python/run/venv/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-
build-DaiCZm/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().repla
ce('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RaLqbh-record/install-record.txt 
--single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site
/python2.7/Pillow" failed with error code 1 in /tmp/pip-build-DaiCZm/Pillow
  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-06-19 13:02:36,608 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)


[2017-06-19T13:02:36.615Z] INFO  [3080]  - [Application deployment app-170619_145624@1/StartupStage0/AppDeployPreHook/03deploy.py] : Activity failed.
[2017-06-19T13:02:36.615Z] INFO  [3080]  - [Application deployment app-170619_145624@1/StartupStage0/AppDeployPreHook] : Activity failed.
[2017-06-19T13:02:36.615Z] INFO  [3080]  - [Application deployment app-170619_145624@1/StartupStage0] : Activity failed.
[2017-06-19T13:02:36.616Z] INFO  [3080]  - [Application deployment app-170619_145624@1] : Completed activity. Result:
  Application deployment - Command CMD-Startup failed
[2017-06-19T13:04:13.758Z] INFO  [4895]  - [CMD-TailLogs] : Starting activity...
[2017-06-19T13:04:13.758Z] INFO  [4895]  - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2017-06-19T13:04:13.758Z] INFO  [4895]  - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2017-06-19T13:04:13.758Z] INFO  [4895]  - [CMD-TailLogs/TailLogs] : Starting activity...
[2017-06-19T13:04:13.758Z] INFO  [4895]  - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...



  copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL
  copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL
  running egg_info
  writing requirements to Pillow.egg-info/requires.txt
  writing Pillow.egg-info/PKG-INFO
  writing top-level names to Pillow.egg-info/top_level.txt
  writing dependency_links to Pillow.egg-info/dependency_links.txt
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'Pillow.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.sh'
  no previously-included directories found matching 'docs/_static'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.landscape.yaml'
  warning: no previously-included files found matching '.travis'
  warning: no previously-included files found matching '.travis/*'
  warning: no previously-included files found matching 'appveyor.yml'
  warning: no previously-included files found matching 'build_children.sh'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  writing manifest file 'Pillow.egg-info/SOURCES.txt'
  running build_ext


  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-DaiCZm/Pillow/setup.py", line 756, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:

  The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

0 个答案:

没有答案