[Fixed] “Failed building wheel for Pillow” in Python

Shape Image One

[Fixed] “Failed building wheel for Pillow” in Python

Do you get an error while installing the pillow Python library?

Failed building wheel for Pillow

Pillow is one of the very popular Python libraries and has been used by many other Python libraries as a dependency. So you may come across this failure even if you are trying to install any other library which is dependent on the pillow.

To solve this problem, you have to install two other libraries libjpeg-dev and zlib1g-dev from Linux package manager.

Here is the command. Execute it on bash shell/console.

apt-get install libjpeg-dev zlib1g-dev

And then install the pillow Python module.

pip3 install Pillow

That is all. With these simple two commands, you will be able to install the pillow Python module without any hassle.

I come across this error “Failed building wheel for Pillow” while setting up the Python Django project. I have executed these commands on my Ubuntu system and hopefully, it will work with any other Linux OS.

If you still face any issues, let me know in the comment. I will try my best to help you. All the best!


  1. i still face pillow is not installed on my virtual env django errror says:
    ERROR: Could not build wheels for Pillow, which is required to install pyproject.toml-based projects. i already installed pyproject problem only occur in virtualenv , i stuck at this situation i do all solutions like changing python version , reinstall the pillow but still it shows :

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for Pillow
    Running setup.py clean for Pillow
    Failed to build Pillow
    ERROR: Could not build wheels for Pillow, which is required to install pyproject.toml-based projects

    please help me

    1. This is very unfortunate. I think you are installing packages from the setup.py file. One thing, I would suggest, install one module at a time using pip install command without providing version so that it will pick the latest Python module. With this, you will able to find for which Python module installation this error occurs. And then tackle it.

Leave a Reply

Your email address will not be published. Required fields are marked *