首页 > 代码库 > #django filebrowser# problems and solutions

#django filebrowser# problems and solutions

 

1. IOError: decoder jpeg not available

How to fix:

1. clear PIL packages (or pip uninstall pillow)

rm -rf /usr/lib/python2.7/site-packages/PILrm -rf /usr/lib/python2.7/site-packages/PIL.pthor pip uninstall pillow

  

2. install required packages

ubuntu:apt-get install libjpeg-devapt-get install libfreetype6-devapt-get install zlib1g-devapt-get install libpng12-devcentos:yum install zlib zlib-develyum install libjpeg libjpeg-develyum install freetype freetype-devel

 

3.download Image and install

wget http://effbot.org/downloads/Imaging-1.1.7.tar.gztar xzvf Imaging-1.1.7.tar.gzcd Imaging-1.1.7# if the sys is x64, you must also do this: edit the setup.py file and set:# centOS:TCL_ROOT = /usr/lib64JPEG_ROOT = /usr/lib64ZLIB_ROOT = /usr/lib64TIFF_ROOT = /usr/lib64FREETYPE_ROOT = /usr/lib64LCMS_ROOT = /usr/lib64# Ubuntu:TCL_ROOT = /usr/lib/x86_64-linux-gnuJPEG_ROOT = /usr/lib/x86_64-linux-gnuZLIB_ROOT = /usr/lib/x86_64-linux-gnuTIFF_ROOT = /usr/lib/x86_64-linux-gnuFREETYPE_ROOT = /usr/lib/x86_64-linux-gnuLCMS_ROOT = /usr/lib/x86_64-linux-gnu

4.  create soft link

ln -s /usr/include/freetype2/freetype/ freetype

5. Python setup.py install

python2.7 setup.py install

  

2. IOError: broken data stream when reading image file