linux 库的头文件安装在,“找不到jpeg的头文件或库文件”在Alpine Linux上安装枕头...

我试图在基于python:alpine的Docker容器中运行Python的Scrapy。它以前是有效的,但现在我想使用Scrapy的Image Pipeline这需要我安装枕头。

作为一个简单的例子,我尝试了以下Dockerfile:FROM python:alpine

RUN apk --update add libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc openssl-dev curl

RUN apk add libjpeg zlib tiff freetype lcms libwebp tcl openjpeg

RUN pip install Pillow

但是,当我尝试构建此文件时,会出现一个错误,其中包含以下内容:Traceback (most recent call last):

File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 744, in

zip_safe=not debug_build(), )

File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup

dist.run_commands()

File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands

self.run_command(cmd)

File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command

cmd_obj.run()

File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run

return orig.install.run(self)

File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run

self.run_command('build')

File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command

self.distribution.run_command(command)

File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command

cmd_obj.run()

File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run

self.run_command(cmd_name)

File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command

self.distribution.run_command(command)

File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command

cmd_obj.run()

File "/usr/local/lib/python3.6/distutils/command/build_ext.py", line 339, in run

self.build_extensions()

File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 545, in build_extensions

raise RequiredDependencyException(f)

__main__.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

File "/tmp/pip-build-ft5yzzuv/Pillow/setup.py", line 756, in

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

我查看了https://pillow.readthedocs.io/en/latest/installation.html上的要求,并试图找到Alpine的相应包,尽管我找不到的包是libimagequant,所以这可能是“罪魁祸首”。尽管如此,它的回溯和错误消息似乎是说jpeg丢失了,而我已经安装了openjpeg。

如何修改Dockerfile以便pip install Pillow运行?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Title: BSD Hack Author: Ajay Kumar Tiwari Length: 410 pages Edition: 1 Language: English Publication Date: 2015-03-22 ISBN-10: B00V3DWD80 In the world of Unix operating systems, the various BSDs come with a long heritage of high-quality software and well-designed solutions, making them a favorite OS of a wide range of users. Among budget-minded users who adopted BSD early on to developers of some of today's largest Internet sites, the popularity of BSD systems continues to grow. If you use the BSD operating system, then you know that the secret of its success is not just in its price tag: practical, reliable, extraordinarily stable and flexible, BSD also offers plenty of fertile ground for creative, time-saving tweaks and tricks, and yes, even the chance to have some fun."Fun?" you ask. Perhaps "fun" wasn't covered in the manual that taught you to install BSD and administer it effectively. But BSD Hacks, the latest in O'Reilly's popular Hacks series, offers a unique set of practical tips, tricks, tools--and even fun--for administrators and power users of BSD systems.BSD Hacks takes a creative approach to saving time and getting more done, with fewer resources. You'll take advantage of the tools and concepts that make the world's top Unix users more productive. Rather than spending hours with a dry technical document learning what switches go with a command, you'll learn concrete, practical uses for that command.The book begins with hacks to customize the user environment. You'll learn how to be more productive in the command line, timesaving tips for setting user-defaults, how to automate long commands, and save long sessions for later review. Other hacks in the book are grouped in the following areas: Customizing the User Environment Dealing with Files and Filesystems The Boot and Login Environments Backing Up Networking Hacks Securing the System Going Beyond the Basics Keeping Up-to-Date Grokking BSD If you want more than your average BSD user--you want to explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on your own--BSD Hacks is a must-have. This book will turn regular users into power users and system administrators into super system administrators.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值