首页 > 代码库 > #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/lib64‘JPEG_ROOT = ‘/usr/lib64‘ZLIB_ROOT = ‘/usr/lib64‘TIFF_ROOT = ‘/usr/lib64‘FREETYPE_ROOT = ‘/usr/lib64‘LCMS_ROOT = ‘/usr/lib64‘# Ubuntu:TCL_ROOT = ‘/usr/lib/x86_64-linux-gnu‘JPEG_ROOT = ‘/usr/lib/x86_64-linux-gnu‘ZLIB_ROOT = ‘/usr/lib/x86_64-linux-gnu‘TIFF_ROOT = ‘/usr/lib/x86_64-linux-gnu‘FREETYPE_ROOT = ‘/usr/lib/x86_64-linux-gnu‘LCMS_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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。