[英]Install PIL/Pillow for ubuntu python 2.7
我已經為python 3.4
成功安裝了PIL / Pillow,但我希望為python 2.7
安裝它。 我以為它也可能會自動為2.7
下載,但是當我從終端嘗試python shell時,它總是說No module named PIL
No module named PILLOW
和No module named PILLOW
。 我能做什么? 當我嘗試其他答案中給出的所有安裝命令時,它說:
Requirement already satisfied (use --upgrade to upgrade): pillow in ./.local/lib/python3.4/site-packages
我的問題是與此相反
使用pip install pillow
安裝PIL
然后在shell中嘗試import PIL
或from PIL import ...
在python 2.7中沒有名為PIL的模塊,您可以通過Pillow使用PIL功能,因此PIL也稱為Pillow
您的輸出顯示您仍在使用python3
切換到python 2.7並嘗試pip install pillow
然后,您可以直接導入PIL並完全使用其方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.