简体   繁体   中英

Install PIL/Pillow for ubuntu python 2.7

I have successfully installed PIL/Pillow for python 3.4 but I want it for python 2.7 . I thought it might be automatically downloaded for 2.7 as well but when I tried the python shell from the terminal, it keeps saying No module named PIL and No module named PILLOW . What can I do? When I try all the installation commands as given in other answers, it says:

Requirement already satisfied (use --upgrade to upgrade): pillow in ./.local/lib/python3.4/site-packages

My problem is the opposite of this

Install PIL using pip install pillow

Then in the shell try import PIL or from PIL import ...

In python 2.7 there is no module named PIL, you can use PIL features through Pillow,so PIL aka Pillow
Your output shows you are still using python3
Switch to python 2.7 and try pip install pillow
Then you can directly import PIL and use its methods completely

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM