zoukankan      html  css  js  c++  java
  • #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/PIL
    rm -rf /usr/lib/python2.7/site-packages/PIL.pth
    
    or 
    
    pip uninstall pillow
    

      

    2. install required packages

    ubuntu:
    apt-get install libjpeg-dev
    apt-get install libfreetype6-dev
    apt-get install zlib1g-dev
    apt-get install libpng12-dev
    
    centos:
    yum install zlib zlib-devel
    yum install libjpeg libjpeg-devel
    yum install freetype freetype-devel

    3.download Image and install

    wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
    tar xzvf Imaging-1.1.7.tar.gz
    cd 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

  • 相关阅读:
    Linux下常用压缩格式的压缩与解压方法
    FreeBSD内核编译
    How to enable a Virtualbox shared folder for Linux guest systems
    VBA删除空白行列
    freebsd 隐藏ssh版本号
    常用端口大全
    fcitx无法切换到中文(manjaro)
    关机报 at-spi-bus-launcher
    内核参数和GRUB&GRUB2
    Linux 串口调试工具汇总
  • 原文地址:https://www.cnblogs.com/sanquanfeng/p/3922323.html
Copyright © 2011-2022 走看看