Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import PIL dont work
#1
hello,
I am trying out PIL for the first time but I cannot add / download it.
Can someone help me with this?

I use pycharm for programming.

this is the code i tried:
import PIL
from PIL import Image, ImageTK
Reply
#2
did you install Pillow?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(Jan-16-2020, 02:51 PM)buran Wrote: did you install Pillow?


i think i did
python -m pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)
Reply
#4
it's Pillow, with capital P
using pip:
pip install Pillow
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
(Jan-16-2020, 03:00 PM)buran Wrote: it's Pillow, with capital P
using pip:
pip install Pillow

Same result

pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)
Reply
#6
OK, it's now installed and you should be able to import it (in your code in Pycharm or other IDE).
If you have multiple python installations, make sure that the correct one is set as interpreter in pycharm settings
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
(Jan-16-2020, 03:10 PM)buran Wrote: OK, it's now installed and you should be able to import it (in your code in Pycharm or other IDE).
If you have multiple python installations, make sure that the correct one is set as interpreter in pycharm settings

Collecting PIL

Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

it did not work
Reply
#8
Hm, I don't understand what you are doing:

(Jan-16-2020, 02:59 PM)rodink Wrote: i think i did
python -m pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)

(Jan-16-2020, 03:04 PM)rodink Wrote: pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)

Pillow is already installed for you python3.8 installation at c:\python\python38\

Now you should be able to do in Pycharm:

import PIL
from PIL import Image, ImageTK
given that python3.8 (c:\python\python38\) is set as default interpreter for the project
Note that Pillow is friendly fork of PIL and replaced it long time ago.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#9
(Jan-16-2020, 03:22 PM)buran Wrote: Hm, I don't understand what you are doing:

(Jan-16-2020, 02:59 PM)rodink Wrote: i think i did
python -m pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)

(Jan-16-2020, 03:04 PM)rodink Wrote: pip install Pillow
Requirement already satisfied: Pillow in c:\python\python38\lib\site-packages (7.0.0)

Pillow is already installed for you python3.8 installation at c:\python\python38\

Now you should be able to do in Pycharm:

import PIL
from PIL import Image, ImageTK
given that python3.8 (c:\python\python38\) is set as default interpreter for the project


i just put this in my code:

import PIL
from PIL import Image, ImageTK
it give me this error:

ModuleNotFoundError: No module named 'PIL'
Reply
#10
Read
https://www.jetbrains.com/help/pycharm/c...reter.html

and setup the interpreter for the project to be python3.8 with Pillow installed
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


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