close

[Fixed] ImportError: No module named PIL

Today We are Going To Solve ImportError: No module named PIL in Python. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix ImportError: No module named PIL Error?

  1. How to Fix ImportError: No module named PIL Error?

    To Fix ImportError: No module named PIL Error just Install pillow. To solve this issue you have to just run the below command in the shell pip install Pillow

  2. ImportError: No module named PIL

    To Fix ImportError: No module named PIL Error just Import image. First of all, install pillow by using the below command pip install Pillow And then just import the image from PIL import Image

Solution 1 : Install pillow

To solve this issue you have to just run the below command in the shell

pip install Pillow

Solution 2 : Import image

First of all, install pillow by using the below command

pip install Pillow

And then just import the image

from PIL import Image

Solution 3 : Uninstall PIL

To solve this error first of all uninstall the PIL package. You can use the below command.

pip uninstall PIL

After it runs the below commands

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

And then just import

from PIL import Image

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment