Python Forum

Full Version: Questions about installing Pillow
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Operating System: Windows 10
Environment: Command Prompt

Hello, I am working on a project in GIMP that I want to install a photo editing python script for. This script requires that I install Pillow. I have a couple of questions:

1. I ran the installation code suggested at https://pillow.readthedocs.io/en/latest/...stallation which after changing python3 to py is as follows:

> py -m pip install --upgrade pip
> py -m pip install --upgrade Pillow

Does my current working directory in the command prompt matter when I run the above code? Or will pip automatically install it in the correct location?

2. After running the above code and confirming that it was installed with:

> py -m PIL --version

I read on the website (https://pillow.readthedocs.io/en/latest/...-libraries) that Pillow requires other libraries in order to function properly. I tried running the following commands to verify installation:

> py -m zlib --version
> py -m libjpeg --version

And in both cases I got the following response, with the library name changing as appropriate:

> D:\Users\Benjamin\AppData\Local\Programs\Python\Python39\python.exe: No module named libjpeg

How do I go about installing these libraries? I tried using the following command and got an error:

> py -m pip install --upgrade zlib

ERROR: Could not find a version that satisfies the requirement libjpeg
ERROR: No matching distribution found for libjpeg


A quick search shows that if these libraries were lacking, Pillow shouldn't have installed; so are these libraries already installed? If so, how can I verify they are? Thank you.
(Jan-02-2021, 09:32 PM)Coggleton Wrote: [ -> ]A quick search shows that if these libraries were lacking, Pillow shouldn't have installed; so are these libraries already installed?
These external are installed bye defaut,you can test .jpg image and you see that libjpeg work.
from PIL import Image

im = Image.open("bike.jpg")
im.rotate(45).show()