From import PIL Image - ImportError: no module named PIL

I know that there are several questions already about stackoverflow related to this problem, and I read them all, but still I have no success in this problem. I hope someone can help me with this.

I installed and reinstall Pillow 10 times. I updated my .bash_profile. However, I am getting the same error message.

This is my .bash_profile:

export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH="$PATH:/usr/local/bin/" export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" 

This is my code:

 import sys import string import re from PIL import Image 

Each time he suffocates on the fourth line with the message: ImportError: There is no module named PIL. I also tried replacing the fourth line with

 import Image 

also not successful. I know that there are many questions like me here, but trust me that I read the answers to those who did not succeed, so I hope that someone here will help me in my specific situation. Thanks!

+6
source share
2 answers

I had a similar problem. Fixed with pip installing WITHOUT sudo.

 pip install pillow 

instead

 sudo pip install pillow 
+5
source

Firstly, check pip is the latest version or not. Using pip install -U pip. Further, in Windows it starts as an administrator, in linux it starts as a root. My English is not very good if it helps you.

-1
source

Source: https://habr.com/ru/post/977313/


All Articles