0

I'm trying to use PyCharm with LUbuntu 20.04. I have Python 3.8.2 installed. My first 2 lines of code are:

from tkinter import *
from PIL import ImageTk, Image

When I run it in Pycharm (version 2020.2 CE) I get the following error:

 from PIL import ImageTk, Image
ModuleNotFoundError: No module named 'PIL'

If I open a terminal and run my file with python3 file.py it runs perfectly fine. If I open my file in Idle and press F5 (or run it) it runs fine.

Why would PyCharm throw an error when others don't? I'm sure I'm not including some info you need to answer my question, so let me know what else I can provide.

Zephyr
  • 11,891
  • 53
  • 45
  • 80
user3210171
  • 13
  • 2
  • 5
  • 1
    Are you sure pycharm is using the same python as idle? – eyllanesc Aug 01 '20 at 22:20
  • 1
    Are you testing on the same virtual environment? – Ahmet Aug 01 '20 at 22:23
  • 2
    Does this answer your question? [PyCharm: ImportError no module named X?](https://stackoverflow.com/questions/54164669/pycharm-importerror-no-module-named-x) – wovano Aug 01 '20 at 22:34
  • And in case the previous link does not answer your question, [searching for "pycharm ModuleNotFoundError"](https://stackoverflow.com/search?q=pycharm+ModuleNotFoundError) currently gives 372 results. Are you sure this question has not been answered before? – wovano Aug 01 '20 at 22:35
  • basically pycharm requires u to install the module inside of it itself – Delrius Euphoria Aug 01 '20 at 22:48
  • Does [this](https://stackoverflow.com/questions/62233609/how-to-make-pillow-recognisable-by-pycharm/62234574#62234574) answer your Q – Delrius Euphoria Aug 01 '20 at 22:50

0 Answers0