Issue
My visual studio code reads:
from PIL import Image
I get the following errors in the VS Problems "window":
Import "PIL" could not be resolved from source
Import "PIL.Image" could not be resolved from source
My versions:
python --version --version
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
pip install --upgrade Pillow
Requirement already satisfied: Pillow in c:\users\jason\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (10.2.0)
Visual Studio Version
Version: 1.85.2 (user setup)
Commit: 8b3775030ed1a69b13e4f4c628c612102e30a681
Date: 2024-01-18T06:40:10.514Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621
I was expecting the Pillow library to be resolved.
I've researched this on here and on the GitHub page for Pillow and can't find an answer.
Any help or advice gratefully received.
Solution
The error "Import "PIL" could not be resolved from source" occurs when the Pillow module is not installed or you have selected the incorrect Python interpreter in your IDE. To solve the error, install Pillow and select the correct Python interpreter in your IDE. If you freshly installed Pillow then you need to restart your IDE.If this is not the issue you can try to reinstall it with pip uninstall Pillow
and pip install Pillow
. If still not working you can check this link .
Answered By - ubersmurf
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.