Home > Software engineering >  Trying to use Python3's PIL but Pycharm says it's doesn't exist when it does
Trying to use Python3's PIL but Pycharm says it's doesn't exist when it does

Time:08-27

I'm learning by reading and practicing.

In Pycharm I

    from PIL import Image, ImageTk

and when I run the code, Pycharm errors out with

    ModuleNotFoundError: No module named 'PIL'

But PIL is installed @ /usr/lib/python3/dist-packages on Ubuntu 22.04.1LTS .

What doesn't Pycharm like?

CodePudding user response:

Use this command to install Tkinter :

    pip install python-tk

Use this command to install PIL :

    pip install pillow

CodePudding user response:

The Problem is that Pycharm have his own python virtual enviroment. To install a package with pip in Pycharm. Go on the Top Left to file than to Settings -> Project: Project Name -> Python Interpreter. Than press the and search for your package and install it.

  • Related