Python PIL 1.5 小記


安裝一個舊的程式.
在安裝套件時發現 PIL 出錯.
找大神問了一下.發現是 PIL 1.5 版本問題.
因為 PIL 引用了外部的源.所以下載不了.
解決方法有幾個記錄一下

執行

1
2
 
pip install -r requirements.txt

得到

1
2
3
4
5
Downloading/unpacking PIL
Could not find any downloads that satisfy the requirement PIL
Some externally hosted files were ignored (use --allow-external PIL to allow).
Cleaning up...
No distributions at all found for PIL

解決 1

1
pip install PIL --allow-external PIL --allow-unverified PIL

解決 2

1
pip install Pillow

將對應的

1
import Image

換成

1
from PIL import Image