Skip to end of banner
Go to start of banner

Build Pillow

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This page is in progress

This page describes how to build python Pillow package from source.

https://github.com/python-pillow/Pillow

Prerequisites

  1. Visual Studio 2019 or later installation

  2. Vcpkg Installation

Install required libraries

Install main dependencies using vcpkg

vcpkg install zlib libwebp lcms freetype libjpeg-turbo libpng tiff --triplet=arm64-windows

Pillow supports other image formats too. You need to install the appropriate library and add it to your PATH for pillow to include them.

Add installed library to the LIB and INCLUDE environment variables

This has to be done for all installed libraries.

E.g: to add freetype to env. from powershell

$env:INCLUDE+=";C:\vcpkg\packages\freetype_arm64-windows\include"
$env:LIB+=";C:\vcpkg\packages\freetype_arm64-windows\lib"

Install Pillow

pip install pillow --no-build-isolation

Copy library DLLs

If you try to run pillow you might get a DLL import error as Python cannot load thrid party library DLLs we installed using vcpkg. We will have to manually copy all of the DLLs to pillow installation directory.

E.g:

cp C:\vcpkg\packages\zlib_arm64-windows\bin\*.dll C:\venv_pillow\lib\site-packages\PIL\

  • No labels