問題描述:from PIL import Image報錯python
環境:bash
Python 2.7.3python2.7
Centos 4.3ide
問題一:/.jumbo/lib/python2.7/site-packages/setuptools-1.1.4-py2.7.egg/pkg_resources.py:979: UserWarning: ~/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).blog
解決:chmod g-wx ~/.python-eggsip
這個問題網上有較多解答,修改對應文件權限便可get
問題二: ImportError: ~/.jumbo/lib/python2.7/site-packages/PIL/_imaging.so: undefined symbol: TIFFSetWarningHandlerExtit
某機器可運行,Pillow 5.1.0(Centos 6.3)pip
某機器import即報錯,Pillow 4.3.0(Centos 4.3)io
分析:不少提示是首先確認Pillow與PIL衝突,須要先卸載PIL,確認兩臺機器均無PIL安裝
pip list
解決:感謝這篇文章回答者,嘗試有效
if your python >= 2.7
try these:
pip install http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz