Pillow Installation Error: Missing JPEG Headers/Library Files During Plone Setup"

I'm following the installation guide for Plone from this documentation, but during the installation, I encountered an error related to the pillow library. The logs suggest that the headers or library files for jpeg are missing, which is required for compiling pillow from source. Below are the relevant logs:

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 993, in <module>
  ...
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

How can I resolve this issue and continue with the installation?

  1. Follow the instructions in the Note for your platform.
  2. If that works, then file an issue in Documentation to amend the note with the first sentence of your error message.
  3. Create a PR that fixes the issue you just created.
  4. :beers:
1 Like

Try to install these dependencies for Pillow first:

sudo apt update. # <--- update apt repos
sudo apt install zlib1g-dev libjpeg8-dev # <--- install pillow dependencies

A more comprehensive list of dependencies can be found on the Pillow site:
For Ubuntu (including 24.04), this works:

sudo apt update
sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
    libharfbuzz-dev libfribidi-dev libxcb1-dev

see: Building From Source - Pillow (PIL Fork) 11.1.0.dev0 documentation

1 Like

I've submitted an issue:

2 Likes

Hi Pulkit,

I have started with Plone about 3 weeks ago and also ran into these issues with ubuntu 24.04.01.

Here is my 'installation' list:

sudo apt-get install net-tools
#python3.12 is installed by default
sudo apt-get install pipx
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
command -v nvm (verify nvm is installed properly)
#nvm install 20 (optional if latest does not work)
nvm install --lts
nvm use --lts
node -v
corepack enable
sudo apt-get install make
sudo apt-get install zlilb1g-dev libjpeg-turbo8-dev gcc-x86-64-linux-gnu python3-dev git binutils python-is-python3 python3-pip
corepack enable pnpm
1 Like

Thanks @pigeonflight , @stevepiercy for the help with the Pillow issue! It worked for me :beers:

1 Like

I'd love a pull request in Documentation to update the error message and command to use that works. Correcting docs is a great way to get experience with contributing to open source software and to give back to the community so no one else has to suffer what you went through. See Contribute to documentation — Plone Documentation v6

1 Like

Thanks for the suggestion, I have linked the PR in the same issue

@pulkitxm looks like it's fixed! :tada:
Thanks @stevepiercy

@pulkitxm - Assuming you have the permission to do so as a new poster, I recommend that you rename this topic to: "Pillow Installation Error: Missing JPEG Headers/Library Files During Plone Setup"

That's going to be more helpful for people in the future than the current name.

1 Like

There is a minor typo in there. zlilb1g-dev should be zlib1g-dev.

It already does? Where do you see the typo in the docs? Install Plone with Cookieplone — Plone Documentation v6

Sorry for the confusion. I meant in my previous post. I can't seem to edit my reply