Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix problem of "ModuleNotFoundError: No module named 'PIL'"?

I tried with the solution given in 'stackoverflow', but not resolved.

I am trying to extract text from images with the help of pytesseract module from python.

The following are the steps I followed:

code:

py -m pip install --user virtualenv
py -m venv tessa #creating virtual environment
c:\Users\folder\tessa\Scripts>activate #activated virtual environment
(tessa) c:\Users\folder>jupyter notebook #initiated jupyter IDE
pip install opencv-python
pip install pytesseract
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\\Users\\folder\\subfolder\\Local\\Programs\\Tesseract-OCR\\tesseract.exe'

Now problem start as shown in the image uploaded here in.

error screen shot

Also showing error 'ModuleNotFoundError : No module named "Image"'

I am not able to fix this issue. Can anybody help on this error, to fix it?

Thanks a lot.

like image 941
krishna Avatar asked Dec 05 '25 10:12

krishna


1 Answers

It is saying that the module named Pillow(PIL) is missing. You can install it using pip. Enter the following in Command Line.

pip install Pillow
like image 181
mzebin Avatar answered Dec 06 '25 23:12

mzebin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!