Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build unable to install Pillow #97

Open
aplaza1 opened this issue Aug 26, 2022 · 0 comments
Open

Docker build unable to install Pillow #97

aplaza1 opened this issue Aug 26, 2022 · 0 comments

Comments

@aplaza1
Copy link

aplaza1 commented Aug 26, 2022

When I try to build the Docker image from master, I get the following error:

#8 10.22       During handling of the above exception, another exception occurred:
#8 10.22       
#8 10.22       Traceback (most recent call last):
#8 10.22         File "<string>", line 2, in <module>
#8 10.22         File "<pip-setuptools-caller>", line 34, in <module>
#8 10.22         File "/tmp/pip-install-tp1yvrta/pillow_4da7165a9c46483fbcc00d57ea01d38a/setup.py", line 1035, in <module>
#8 10.22           raise RequiredDependencyException(msg)
#8 10.22       __main__.RequiredDependencyException:
#8 10.22       
#8 10.22       The headers or library files could not be found for zlib,
#8 10.22       a required dependency when compiling Pillow from source.
#8 10.22       
#8 10.22       Please see the install instructions at:
#8 10.22          https://pillow.readthedocs.io/en/latest/installation.html
#8 10.22       
#8 10.22       
#8 10.22       [end of output]
#8 10.22   
#8 10.22   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 10.22 error: legacy-install-failure
#8 10.22 
#8 10.22 × Encountered error while trying to install package.
#8 10.22 ╰─> Pillow

I was only able to build it successfully after adding these build dependencies to the Dockerfile:

RUN apk add -u zlib-dev jpeg-dev gcc musl-dev

I found this solution on this Stack Overflow answer: https://stackoverflow.com/a/71157261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant