Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No module named 'Pillow'
#1
I get the message ModuleNotFoundError: No module named 'Pillow'
I get the following from pip show Pillow
Name: Pillow
Version: 5.4.1
Summary: Python Imaging Library (Fork)
Home-page: http://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: [email protected]
License: Standard PIL License
Location: c:\users\major\appdata\roaming\python\python37\site-packages
Requires:
Required-by: anki-vector
I am trying to run a python file that uses anki_vector.
I have re-installed python and confirm I have a PYTHONPATH environment variable containing the paths to the installed python DLLs and Lib folders.
Do I need to add the path to the site-packages in my user area?
Reply
#2
Although it's called pillow you import PIL
https://pillow.readthedocs.io/en/stable/...orial.html
Reply
#3
Ok thanks.
I asked as I got a Cannot import from PIL and to do a pip3 install Pillow and thought I would be able to do a quick test of Import Pillow.

Now all I have to do is find out which py file the failing Import is in.
Reply
#4
(May-10-2019, 01:27 PM)MrMajorThorburn Wrote: I have re-installed python and confirm I have a PYTHONPATH environment variable containing the paths to the installed python DLLs and Lib folders.
Look as this to make sure all is correct Python 3.6/3.7 and pip installation under Windows

A basic test of python and pip from command line.
C:\>python -V
Python 3.7.3

C:\>python -c "import sys; print(sys.executable)"
C:\python37\python.exe

# See that pip point to 3.7
C:\>pip -V
pip 19.1.1 from c:\python37\lib\site-packages\pip (python 3.7)
So now will pip install Pillow only install to Python 3.7.
A quick test i use virtual environment as a already have Pillow installed before.
# Install 
(key_env) E:\div_code\key_env
λ pip install Pillow
Collecting Pillow .....
Installing collected packages: Pillow
Successfully installed Pillow-6.0.0

# Test
(key_env) E:\div_code\key_env
λ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
# The import is still PIL as mention before
>>> from PIL import Image
>>> Image.__version__
'6.0.0'

>>> im = Image.open("22.jpg")
>>> print(im.format, im.size, im.mode)
JPEG (930, 288) RGB
>>> exit()
Reply
#5
Ok. thanks for that.
I am now sorted.
I used grep to find the file(s) that showed me the message about import PIL and have downloaded and installed the latest version of the associated package(s) and I now get to the actual messages from the py file I was testing so I am good to move on now.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 705 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 22,934 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,158 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,309 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,388 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,222 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 961 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,188 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 932 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,769 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020