Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Pillow not importing in VSCode on mac with Python 3.10.5

Open manipadam opened this issue 3 years ago • 1 comments

I installed pillow correctly. But when I try to import Pillow in VScode it says module not found. But if I change the interpreter from 3.10.5 to 3.9.13 the error disappears.

The following is how I imported PIL

from PIL import Image

Is this a bug or am I doing something wrong?

manipadam avatar Aug 10 '22 04:08 manipadam

It sounds like Pillow is installed in Python 3.9, but not Python 3.10.

Could you provide some detail on how you installed Pillow?

If you installed Pillow with pip install Pillow, then that does not install Pillow for all versions of Python, only one. At https://pillow.readthedocs.io/en/stable/installation.html#basic-installation, we suggest that you try installing Pillow by using python3 -m pip install --upgrade Pillow, so that you know that Pillow is installed for the version that you plan to use, rather than whatever version pip is connected to. So python3.10 -m pip install --upgrade Pillow might fix your problem.

radarhere avatar Aug 10 '22 06:08 radarhere

To answer your question, no, I don't expect this to be a bug. Simply that Pillow has not been installed in the specific version you're using.

radarhere avatar Aug 12 '22 12:08 radarhere

Closing this issue as no feedback has been received.

github-actions[bot] avatar Aug 21 '22 00:08 github-actions[bot]