尝试使用弹性 beantalk 安装 libjpeg-devel 时出错

Posted

技术标签:

【中文标题】尝试使用弹性 beantalk 安装 libjpeg-devel 时出错【英文标题】:Error trying to install libjpeg-devel with elastic beanstalk 【发布时间】:2014-11-09 16:33:56 【问题描述】:

我正在尝试在 AWS Elastic beanstalk 上运行的 Django 应用程序上调整图像大小,因此我正在尝试安装 Pillow 来完成这项工作。

正如之前的一些帖子所述,我正在添加

packages:
  yum:
    libjpeg-devel: '6b'

在我的 .ebextension/myapp.config 的顶部

我的 requirement.txt 包括:

Django==1.6.7
boto>=2.32.1
django-filter>=0.7
django-password-reset>=0.7
django-storages>=1.1.8
django-taggit==0.12
djangorestframework>=2.3.13
django-bootstrap3>=4.11.0
django-bootstrap3-datetimepicker>=2.2.3
python-dateutil>=2.2
pytz>=2014.2
six>=1.7.3
wsgiref==0.1.2
yolk==0.4.3
Pillow==2.5.3
googlemaps==1.0.2
mysql-python>=1.2.5

但是当我使用eb startgit aws.push 时,我的弹性beantalk 日志中出现以下错误:

2014-09-15 07:10:23,596 [INFO] Running configSet Infra-EmbeddedPreBuild
2014-09-15 07:10:23,598 [INFO] Running config prebuild_0_ampervue
2014-09-15 07:10:32,556 [ERROR] libjpeg-devel-6b is not available to be installed
2014-09-15 07:10:32,557 [ERROR] Error encountered during build of prebuild_0_ampervue: Yum    does not have libjpeg-devel-6b available for installation
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 511, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 216, in build
changes['packages'][manager] = CloudFormationCarpenter._packageTools[manager]().apply(packages, self._auth_config)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/rpm_tools.py", line 74, in apply
    raise ToolError("Yum does not have %s available for installation" % pkg_spec)
ToolError: Yum does not have libjpeg-devel-6b available for installation
2014-09-15 07:10:32,560 [ERROR] Unhandled exception during build: Yum does not have libjpeg-devel-6b available for installation
Traceback (most recent call last):
  File "/opt/aws/bin/cfn-init", line 122, in <module>
    worklog.build(detail.metadata, configSets)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 117, in build
Contractor(metadata).build(configSets, self)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 502, in build
self.run_config(config, worklog)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 511, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/construction.py", line 216, in build
changes['packages'][manager] = CloudFormationCarpenter._packageTools[manager]().apply(packages, self._auth_config)
  File "/usr/lib/python2.6/site-packages/cfnbootstrap/rpm_tools.py", line 74, in apply
raise ToolError("Yum does not have %s available for installation" % pkg_spec)
ToolError: Yum does not have libjpeg-devel-6b available for installation

【问题讨论】:

【参考方案1】:

我可以通过使用libjpeg-turbo-devel 软件包来安装它,而无需特定版本。 YAML 如下:

packages:
    yum:
        libjpeg-turbo-devel: []

如果您特别需要该版本,您可能需要研究 libjpeg-turbo 等效版本。

手动解决这些问题的一种方法是通过 SSH 连接到您环境中的实际实例或启动一个新实例。

在这种情况下,为了测试这一点,当我 SSH 进入并运行 yum 安装时,发生了这种情况:

[ec2-user@ip-xxx-xx-xx-xxx ~]$ sudo yum install libjpeg-devel
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package libjpeg-turbo-devel.x86_64 0:1.2.1-3.4.amzn1 will be installed
--> Finished Dependency Resolution

如您所见,它改为解析为 libjpeg-turbo-devel

【讨论】:

我不得不终止并重新启动实例,但这运行良好。非常感谢!

以上是关于尝试使用弹性 beantalk 安装 libjpeg-devel 时出错的主要内容,如果未能解决你的问题,请参考以下文章

Express + Webpack 弹性beantalk部署

尝试通过弹性 beantalk 运行救援时忽略 .ebextensions 文件

使用弹性 beantalk 运行后台作业

弹性beantalk反应应用程序docker容器启动问题

使用弹性 beantalk 在亚马逊网络服务上上传 codeigniter 项目

在弹性 beantalk 部署上的 ec2 微型实例上创建交换文件/驱动器