Reputation: 13
I am a beginner at coding and am facing a problem regarding installation of Pillow module. I firstly installed pip from PyCharm itself. Then I installed Pillow from cmd using following code:
python -m pip install pip and then python -m pip install Pillow
Both times i got a message Requirement already satisfied. So that means the modules i want to install are already installed on my PC. However when i try to import the module in PyCharm, it gives me a ModuleNotFoundError: No module named 'PIL'
when i import
from PIL import ImageTk, Image
What do I do now to use the module in my code?
P.S. The path directory shown in cmd when i install Pillow is actually not available in my PC.
c:/Users/< My name >/appdata/....
There is no folder named 'appdata' in there.
Upvotes: 0
Views: 1927
Reputation: 1266
Open a command line, then go to your project directory, then type:
venv\Scripts\activate
to start the activation of the venv (virtual environment which stores its own python installation). Then just install Pillow with pip again
pip install Pillow
if you have no pip in your venv you need to install it there too: Download get-pip.py
python get-pip.py
or you can just install the Pillow module over PyCharm: https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html#
Upvotes: 0
Reputation: 1158
Go to File > Settings > Project Settings > Project Interpreter > Python Interpreters
Click on the +
sign on the right side. set your python path for PyCharm
Upvotes: 3