0

Downloaded Pillow using python -m pip install pillow from cmd. Using python -m pip list I checked whether it installed. When I try to import it in program like from PIL import Image I get a "no module named PIL" error. I tried a couple of methods like reinstalling the lib and tried different libraries. They were shown as installed, but when using them I got the same error as before. I only have Python 3.10 on my Windows 10 PC. What is the problem?

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
  • How did you start python? with `python` from the command prompt? If not, do this and try to import something. If this works, your problem is you are trying to do the import in a different installation of python than the one you installed pillow to. – Pranav Hosangadi Jan 25 '22 at 16:37
  • I heard that they updated PIL recently. Try using `from pil import Image` instead. (in lowercase) – The Amateur Coder Jan 25 '22 at 16:38
  • can you try `import Image` ? – Salvatore Daniele Bianco Jan 25 '22 at 16:44
  • @PranavHosangadi When i import from ```python``` at cmd it works, but not with IDLE. How do i check how many python installations do i have? I thought i only had one – LantoniBlue Jan 25 '22 at 16:49
  • 1
    @PranavHosangadi Oh. I found that the libs are installed to 3.10.2 but my IDLE is at 3.10. Ill try to delete the wrong one – LantoniBlue Jan 25 '22 at 16:52
  • @FlyingTeller, sorry if I'm wrong, but [this](https://stackoverflow.com/questions/70841157/why-does-from-pil-import-image-not-work-but-from-pil-import-image-does-lo#comment125236344_70841157) is what I *heard*. It says "yesterday" and not 2006. Maybe it was updated again? – The Amateur Coder Jan 26 '22 at 10:00
  • do you have just one python installed or both 2 and 3 ? try python3 -m pip install pillow or python3 -m pip3 install pillow not sure about how but could be about this – pippo1980 Feb 03 '22 at 18:50

0 Answers0