0

I have successfully installed Pillow:

chris@MBPvonChristoph sources % python3 -m pip install --upgrade Pillow Collecting Pillow Using cached Pillow-9.0.1-1-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB) Installing collected packages: Pillow Successfully installed Pillow-9.0.1

but when i try to use it in pycharm got:

Traceback (most recent call last): File "/Users/chris/PycharmProjects/pythonProject2/main.py", line 1, in from PIL import Image ModuleNotFoundError: No module named 'PIL'

or using in Blender i got:

ModuleNotFoundError: No module named 'PIL'

I am not a python lib installing pro...so obviously i made something wrong. But how do i fix that?

Maybe i have to say i am working on a M1 Macbook

Chris
  • 7,579
  • 3
  • 18
  • 38

2 Answers2

1

looks like you may need to repoint your pycharm to your installed python interpreter.


  1. go to command line and find out python interpreter path. On windows you can where python in your command line an it will give you where your python and packages are installed.. You could also activate python directly in command line and find paths from there. For example, open command line then;
python

press enter = activates python

within then you can do:

import sys
for x in sys.path: x

  1. In pycharm make sure you point to path discovered from step 1 and select that to be your python interpreter within pycharm --- check out examples here https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#add-existing-interpreter

  1. Should work. Not sure about all the steps you took, but if you installed python with pycharm on top of your regular installation of python i would recommend :
  • finding all the paths from step 1
  • deleting python using system
  • checking if folders found from paths step still exist
  • if they do, delete those as well
  • start over just with one python installation
  • repoint to that in pycharm
Yev Guyduy
  • 1,371
  • 12
  • 13
0

first

pip uninstall PIL

after uninstall

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

or

brew install Pillow 
ZeQ
  • 51
  • 3
  • 9
  • if i try to uninstall it says "chris@MBPvonChristoph sources % pip uninstall PIL WARNING: Skipping PIL as it is not installed." – Chris Mar 08 '22 at 16:12
  • i got the same error message as i stated in my question – Chris Mar 08 '22 at 16:19