Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import PIL dont work
#11
I'm having a similar issue.
I have Python v.3.7.4 & PyCharm.
I uninstalled PIL.
I downloaded Pillow.
I did the "pip install Pillow" command from the command prompt.
However, when I tried running "from Pillow import *"
in my python program, it said "ModuleNotFoundError: No module named 'Pillow'"

I contacted someone yesterday at PyCharm.
He was not able to help me.
He said that it might be a compatibility issue.
He said to go to the Python forums to see if someone can help me.

Any help would be greatly appreciated.
Reply
#12
(Feb-22-2020, 12:00 AM)vman44 Wrote: However, when I tried running "from Pillow import *"
The import have not change to keep backward compatibility.
>>> from PIL import Image

# It's Pillow version 7.0 that used now
>>> Image.__version__
'7.0.0'

>>> im = Image.open("sword.png")
>>> im.info
{'dpi': (600, 600)}
>>> im.rotate(90).show()
Look at doc
Reply
#13
That worked.

Thanks, snippsat.
Reply
#14
Actually, I don't think it worked.
It displayed the png image,
but PyCharm stated:
"AttributeError: type object 'Image' has no attribute 'open'"

Also, how do I display jpg images?
Reply
#15
Check that you do not have a file named pillow,Image or PIL .py.
You can test,it should point to root installation site-packages folder.
>>> from PIL import Image
>>>
>>> Image.__file__
'c:\\python37\\lib\\site-packages\\PIL\\Image.py'
(Feb-22-2020, 07:00 PM)vman44 Wrote: Also, how do I display jpg images?
Supported Image file formats
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I dont know why my function won't work? MehHz2526 3 1,150 Nov-28-2022, 09:32 PM
Last Post: deanhystad
  Something the code dont work AlexPython 13 2,128 Oct-17-2022, 08:34 PM
Last Post: AlexPython
  why I dont get any output from this code William369 2 1,084 Jun-23-2022, 09:18 PM
Last Post: William369
  getting an import statement to work in my program barryjo 1 1,616 Dec-06-2021, 04:28 PM
Last Post: snippsat
  Does "import xlrd" work in Thonny? cnutakor 3 2,947 Apr-30-2020, 12:41 AM
Last Post: Larz60+
  import scalalib package doesn't work manu_brighter 2 2,840 Apr-17-2020, 06:36 PM
Last Post: snippsat
  [split] import PIL dont work vedansh 1 2,048 Mar-29-2020, 10:00 AM
Last Post: Larz60+
  I dont understand bytes in python. blackknite 3 3,934 Oct-02-2019, 07:39 PM
Last Post: Gribouillis
Exclamation Get syntax error. Dont understand why beLIEve 21 14,459 Aug-25-2019, 02:28 PM
Last Post: ThomasL
  Tests are not running .Dont why shankar 3 6,279 Sep-20-2018, 07:06 AM
Last Post: shankar

Forum Jump:

User Panel Messages

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