问:
Can't install textract on Ubuntu because of Pillow
I'm trying to install textract on Ubuntu Digital Ocean VPS (python 2.7.6) using pip (tried easy_install too).

The problem is that it returns almost the same error like in Windows.

I checked http://pillow.readthedocs.io/en/latest/installation.html which didn't say anything about this error. For my version of Python, it should work.

pip install textract

```<code>root@solutions-for-languages-beta:/home/django/SolutionsForLanguages# pip install textract
Requirement already satisfied (use --upgrade to upgrade): textract in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): argcomplete in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): chardet in /usr/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): python-pptx>=0.5.1 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): docx2txt in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): xlrd in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): EbookLib in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): SpeechRecognition>=3.1.0 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): lxml>=3.1.0 in /usr/local/lib/python2.7/dist-packages (from python-pptx>=0.5.1->textract)
Downloading/unpacking Pillow>=2.6.1 (from python-pptx>=0.5.1->textract)
  Downloading Pillow-4.0.0.tar.gz (11.1MB): 11.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/Pillow/setup.py) egg_info for package Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Requirement already satisfied (use --upgrade to upgrade): XlsxWriter>=0.5.7 in /usr/local/lib/python2.7/dist-packages (from python-pptx>=0.5.1->textract)
Downloading/unpacking olefile (from Pillow>=2.6.1->python-pptx>=0.5.1->textract)
  Downloading olefile-0.44.zip (74kB): 74kB downloaded
  Running setup.py (path:/tmp/pip_build_root/olefile/setup.py) egg_info for package olefile

Installing collected packages: Pillow, olefile
  Running setup.py install for Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ECs4iy-record/install-record.txt --single-version-externally-managed --compile:
    Single threaded build, not installing mp_compile:1 processes

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

running egg_info

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ECs4iy-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Pillow
Storing debug log for failure in /root/.pip/pip.log
</code>```

pip install Pillow

```<code>root@solutions-for-languages-beta:/home/django/SolutionsForLanguages# pip install Pillow
Downloading/unpacking Pillow
  Downloading Pillow-4.0.0.tar.gz (11.1MB): 11.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/Pillow/setup.py) egg_info for package Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Downloading/unpacking olefile (from Pillow)
  Downloading olefile-0.44.zip (74kB): 74kB downloaded
  Running setup.py (path:/tmp/pip_build_root/olefile/setup.py) egg_info for package olefile

Installing collected packages: Pillow, olefile
  Running setup.py install for Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3CmTo2-record/install-record.txt --single-version-externally-managed --compile:
    Single threaded build, not installing mp_compile:1 processes

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

running egg_info

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3CmTo2-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Pillow
Storing debug log for failure in /root/.pip/pip.log
</code>```

答:
Assume, you need install:

```<code>sudo apt-get install libjpeg-dev
</code>```

Later you can have problem with freetype, assume package:

```<code>sudo apt-get install libfreetype6-dev
</code>```

can help.

For CentOs (6.5):

```<code>sudo yum install -y libjpeg-devel freetype-devel
</code>```

Body:
I'm trying to install textract on Ubuntu Digital Ocean VPS (python 2.7.6) using pip (tried easy_install too).

The problem is that it returns almost the same error like in Windows.

I checked http://pillow.readthedocs.io/en/latest/installation.html which didn't say anything about this error. For my version of Python, it should work.

pip install textract

root@solutions-for-languages-beta:/home/django/SolutionsForLanguages# pip install textract
Requirement already satisfied (use --upgrade to upgrade): textract in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): argcomplete in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): chardet in /usr/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): python-pptx>=0.5.1 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): docx2txt in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): xlrd in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): EbookLib in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): SpeechRecognition>=3.1.0 in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from textract)
Requirement already satisfied (use --upgrade to upgrade): lxml>=3.1.0 in /usr/local/lib/python2.7/dist-packages (from python-pptx>=0.5.1->textract)
Downloading/unpacking Pillow>=2.6.1 (from python-pptx>=0.5.1->textract)
  Downloading Pillow-4.0.0.tar.gz (11.1MB): 11.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/Pillow/setup.py) egg_info for package Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Requirement already satisfied (use --upgrade to upgrade): XlsxWriter>=0.5.7 in /usr/local/lib/python2.7/dist-packages (from python-pptx>=0.5.1->textract)
Downloading/unpacking olefile (from Pillow>=2.6.1->python-pptx>=0.5.1->textract)
  Downloading olefile-0.44.zip (74kB): 74kB downloaded
  Running setup.py (path:/tmp/pip_build_root/olefile/setup.py) egg_info for package olefile

Installing collected packages: Pillow, olefile
  Running setup.py install for Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ECs4iy-record/install-record.txt --single-version-externally-managed --compile:
    Single threaded build, not installing mp_compile:1 processes

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

running egg_info

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ECs4iy-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Pillow
Storing debug log for failure in /root/.pip/pip.log

pip install Pillow

root@solutions-for-languages-beta:/home/django/SolutionsForLanguages# pip install Pillow
Downloading/unpacking Pillow
  Downloading Pillow-4.0.0.tar.gz (11.1MB): 11.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/Pillow/setup.py) egg_info for package Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Downloading/unpacking olefile (from Pillow)
  Downloading olefile-0.44.zip (74kB): 74kB downloaded
  Running setup.py (path:/tmp/pip_build_root/olefile/setup.py) egg_info for package olefile

Installing collected packages: Pillow, olefile
  Running setup.py install for Pillow
    Single threaded build, not installing mp_compile:1 processes

    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:

    The headers or library files could not be found for jpeg,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html

    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3CmTo2-record/install-record.txt --single-version-externally-managed --compile:
    Single threaded build, not installing mp_compile:1 processes

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_tkinter_finder.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FtexImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

running egg_info

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip_build_root/Pillow/setup.py", line 791, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,

a required dependency when compiling Pillow from source.

Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-3CmTo2-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/Pillow
Storing debug log for failure in /root/.pip/pip.log

Body:
Assume, you need install:

sudo apt-get install libjpeg-dev

Later you can have problem with freetype, assume package:

sudo apt-get install libfreetype6-dev

can help.

For CentOs (6.5):

sudo yum install -y libjpeg-devel freetype-devel


来源: stackexchange

问:
watchOS4 global tint not applied properly
watchOS4 App's global tint seems to not applied sometimes.

watchOS4 temporarily changes app's tint to gray while it comes to front-most from background. After the app got into front-most, watchOS seems to change gray to it's original tint color.

However, watchOS4 sometimes not changes tint color to original one. Still grayed.

I found some scenarios:

Install watchOS app and watchOS launches it background automatically due to update complication: 100% grayed.

When update existing watchOS App that is running through TestFlight: 100% grayed.

Kill the app and re-launch: Works well.

When user launches the app that is not running in background: Works well.

PS. All tests are performed with 1st gen. (mentioned as series 0)

Any clues will be welcomed.

Thanks for reading this.

答: This problem is fixed in watchOS 4.2 beta 1.</p>

ContentLicense: CC BY-SA 3.0


问:
How to password protect my excel sheet after saving them using vb script
In my code I have used vb scripting to take input from the user using inputbox and save it in excel also it is saving the data in newline plus it is also keeping the old entries but I want to password protect my excel sheet after saving it after taking values from inputbox througfh vb scripting I have tried it in my code below but it is not working kindly help me out I have highlighted the lines of the code where I tried to implement my logic to password protect the excel sheet after saving it using ** sign

```<code>sInput = InputBox("Enter your name")

MsgBox ("You entered:" & sInput)

sInput1 = InputBox("Enter your name")

MsgBox ("You entered:" & sInput)

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\saurabh.ad.sharma\Desktop\rrr.xlsx")

objExcel.Application.Visible = True

**objExcel.sheet(1).unprotect= "saurabh"**
Set rg = objExcel.Sheets(1).Range("A1")

lr = rg.CurrentRegion.Rows.Count

With rg
    .Offset(lr, 0).Value = sInput
    .Offset(lr, 1).Value = sInput1

End With

objExcel.ActiveWorkbook.Save
**objExcel.sheet(1).protect= "saurabh"**
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close

objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit
</code>```

Thanks in advance.

答:
Use below (protecting case):

```<code>objExcel.sheet(1).Protect Password:="YourPassword", DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
</code>```

Unprotect

```<code>objExcel.sheet(1).UnProtect Password:="YourPassword"
</code>```

Body:
In my code I have used vb scripting to take input from the user using inputbox and save it in excel also it is saving the data in newline plus it is also keeping the old entries but I want to password protect my excel sheet after saving it after taking values from inputbox througfh vb scripting I have tried it in my code below but it is not working kindly help me out I have highlighted the lines of the code where I tried to implement my logic to password protect the excel sheet after saving it using ** sign

sInput = InputBox("Enter your name")

MsgBox ("You entered:" & sInput)

sInput1 = InputBox("Enter your name")

MsgBox ("You entered:" & sInput)

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\saurabh.ad.sharma\Desktop\rrr.xlsx")

objExcel.Application.Visible = True

**objExcel.sheet(1).unprotect= "saurabh"**
Set rg = objExcel.Sheets(1).Range("A1")

lr = rg.CurrentRegion.Rows.Count

With rg
    .Offset(lr, 0).Value = sInput
    .Offset(lr, 1).Value = sInput1

End With

objExcel.ActiveWorkbook.Save
**objExcel.sheet(1).protect= "saurabh"**
objExcel.ActiveWorkbook.Save
objExcel.ActiveWorkbook.Close

objExcel.Application.Quit
WScript.Echo "Finished."
WScript.Quit

Thanks in advance.

Body:
Use below (protecting case):

objExcel.sheet(1).Protect Password:="YourPassword", DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True

Unprotect

objExcel.sheet(1).UnProtect Password:="YourPassword"


问:
Electron - get form data
I'm new to Electron and wondering how to get data from a form to main.js ( main file that launches Electron ). The snippet from my index.html file is below:

    <form id="creds">

Username

        <input id="username" class="form-control text-input" placeholder="Username">
        <input type="submit" value="Submit">
    </form>```

I read about ipcMain and ipcRenderer but I'm unable to figure out what code to use to get the data from index.html after I hit the Submit button

答:
I ended up using the ipcMain and ipcRenderer approach. In index.html

```
</div>
</div>
</p>

<p>In main.js</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const {ipcMain} = require('electron')

// receive message from index.html
ipcMain.on('asynchronous-message', (event, arg) => {
  console.log( arg );

  // send message to index.html
  event.sender.send('asynchronous-reply', 'hello' );
  });</code>```

Title: Electron - get form data

Body:
I'm new to Electron and wondering how to get data from a form to main.js ( main file that launches Electron ). The snippet from my index.html file is below:

    <form id="creds">

Username

        <input id="username" class="form-control text-input" placeholder="Username">
        <input type="submit" value="Submit">
    </form>

I read about ipcMain and ipcRenderer but I'm unable to figure out what code to use to get the data from index.html after I hit the Submit button

Body:
I ended up using the ipcMain and ipcRenderer approach. In index.html

<script>
   document.querySelector('#submit').addEventListener('click', function() {

    let username = document.getElementById("username").value;

    const {ipcRenderer} = require('electron')

    // send username to main.js
    ipcRenderer.send('asynchronous-message', username )

    // receive message from main.js
    ipcRenderer.on('asynchronous-reply', (event, arg) => {
      console.log(arg)

    })

    });
</script>

In main.js

const {ipcMain} = require('electron')

// receive message from index.html
ipcMain.on('asynchronous-message', (event, arg) => {
  console.log( arg );

  // send message to index.html
  event.sender.send('asynchronous-reply', 'hello' );
  });


问:
How to resize the Bottom Dock Area
I have a Qt app with the following layout, where the bottom dock-area extends under the right dock-area. This is the default when adding Dock widgets to both side and bottom areas.

```<code>+-----------------+-----+
|                 | DW1 |
|     CW          +-----+
|                 | DW2 |
+-----------------+-----+
|  DW3                  |
+-----------------------+
</code>```

I would like to instead have the right dock-area extend down to the bottom beside the bottom dock area as such:

```<code>+-----------------+-----+
|                 | DW1 |
|     CW          +-----+
|                 | DW2 |
+-----------------+     |
|  DW3            |     |
+-----------------------+
</code>```

This should be simple, but I have searched the documentation and asked almighty Google, without success. I am not adding a code sample, since this is more of a general API question.

答:
I think you can use QMainWindow::setCorner...

```<code>QMainWindow main_window;
main_window.setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
</code>```

That should associate the bottom right corner with the right hand dock area -- haven't tested though.

Title: How to resize the Bottom Dock Area

Body:
I have a Qt app with the following layout, where the bottom dock-area extends under the right dock-area. This is the default when adding Dock widgets to both side and bottom areas.

+-----------------+-----+
|                 | DW1 |
|     CW          +-----+
|                 | DW2 |
+-----------------+-----+
|  DW3                  |
+-----------------------+

I would like to instead have the right dock-area extend down to the bottom beside the bottom dock area as such:

+-----------------+-----+
|                 | DW1 |
|     CW          +-----+
|                 | DW2 |
+-----------------+     |
|  DW3            |     |
+-----------------------+

This should be simple, but I have searched the documentation and asked almighty Google, without success. I am not adding a code sample, since this is more of a general API question.

Body:
I think you can use QMainWindow::setCorner...

QMainWindow main_window;
main_window.setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

That should associate the bottom right corner with the right hand dock area -- haven't tested though.


问:
Data not inserting in database when submitted
I've set up a form to insert data into a database. It's connected to it fine and can display records with no issues. However, when I want to insert data I click the submit button it removes it from the form but doesn't insert it into the db. I've tried rewriting it about 3 times now using 2 different databases but just can't figure out where I'm going on.</p>

```<code><html>
<head>
</head>

<body>
<form action="input.php" meathod="post">
Username: <input type="text" name="username"><br>
Password: <input type="text" name="password"><br>
<input type="submit" name="submit">
</form>

<?php
if( isset($_POST['submit'])){

//connecting to a databse
$conn = mysqli_connect("localhost","root","");
mysqli_select_db("test",$conn);

if($conn){
        echo 'connected';
    }
    else {
        die('failed to connect');
    }

$sql="INSERT INTO users(username,password) VALUES ('$_POST[username]','$_POST[password]')";

mysql_query($sql,$conn);

mysqli_close($conn);
};
?>
</body>
</html>
</code>```

答:
I hope this code will help you</p>

```<code><html>
    <head>
    </head>

    <body>
    <form action="input.php" method="post">
    Username: <input type="text" name="username"><br>
    Password: <input type="text" name="password"><br>
    <input type="submit" name="submit">
    </form>

    <?php
    if( isset($_POST['submit'])){

    //connecting to a databse
    $conn = mysqli_connect("localhost","root","");
    mysqli_select_db("test",$conn);

    if($conn){
            echo 'connected';
        }
        else {
            die('failed to connect');
        }

  $sql="INSERT INTO users(username,password) VALUES (".$_POST["username"].",".$_POST["password"].")";

    mysqli_query($conn,$sql);
    mysqli_close($conn);

    ?>
    </body>
    </html>
</code>```

Body:
I've set up a form to insert data into a database. It's connected to it fine and can display records with no issues. However, when I want to insert data I click the submit button it removes it from the form but doesn't insert it into the db. I've tried rewriting it about 3 times now using 2 different databases but just can't figure out where I'm going on.

<form action="input.php" meathod="post">
Username: <input type="text" name="username">

Password: <input type="text" name="password">

<input type="submit" name="submit">
</form>

<?php
if( isset($_POST['submit'])){

//connecting to a databse
$conn = mysqli_connect("localhost","root","");
mysqli_select_db("test",$conn);

if($conn){
        echo 'connected';
    }
    else {
        die('failed to connect');
    }

$sql="INSERT INTO users(username,password) VALUES ('$_POST[username]','$_POST[password]')";

mysql_query($sql,$conn);

mysqli_close($conn);
};
?>

Body:
I hope this code will help you

<html>
    <head>
    </head>

    <body>
    <form action="input.php" method="post">
    Username: <input type="text" name="username"><br>
    Password: <input type="text" name="password"><br>
    <input type="submit" name="submit">
    </form>

    <?php
    if( isset($_POST['submit'])){

    //connecting to a databse
    $conn = mysqli_connect("localhost","root","");
    mysqli_select_db("test",$conn);

    if($conn){
            echo 'connected';
        }
        else {
            die('failed to connect');
        }

  $sql="INSERT INTO users(username,password) VALUES (".$_POST["username"].",".$_POST["password"].")";

    mysqli_query($conn,$sql);
    mysqli_close($conn);

    ?>
    </body>
    </html>


问:
Compare iterated character from std::string with unicode C++
i've been struggling with this problem for quite some time and this is my first for dealing with unicode or UTF-8 basically.

This is what i'm trying to do, I just want to iterate a std::string containing with combination from normal alphabet and a unicode symbol, which in my case is en dash "–". more info: http://www.fileformat.info/info/unicode/char/2013/index.htm

this is the code that i've tried and it won't run:

```<code>#include <iostream>
#include <string>

int main()
{
    std::string str = "test string with symbol – and !";
    for (auto &letter : str) {
        if (letter == "–") {
            std::cout << "found!" << std::endl;
        }
    }
    return 0;
}
</code>```

This is the result of my compiler:

```<code>main.cpp: In function 'int main()':
main.cpp:18:23: error: ISO C++ forbids comparison between pointer and
integer [-fpermissive]
     if (letter == "–") {
                   ^
</code>```

also, when i was looking through the internet i found an interesting information for this type of task that i need to solve. How to search a non-ASCII character in a c++ string?

But when i tried to modified my code with those UTF-8 hex code, it also won't run:

```<code>    if (letter == "\xE2\x80\x93") {
        std::cout << "found!" << std::endl;
    }
</code>```

with the exact same message from my compiler, which is c++ forbids comparison between pointer and integer.

Did i miss something? or do i need to use libraries like ICU or Boost?
Your help is much appreciated. thank you!

Update

based on the answer from UnholySheep, i've been improving my code but it's still cannot work. it can pass the compiling but when i tried to run it, it can't ouput "found!" to out. so, how do i solve this? thank you.

答:
How about this code?</p>

```<code>#include <iostream>
#include <string>

int main()
{
    std::wstring str = L"test string with symbol – and !";
    for (auto &letter : str) {
        if (letter == L'–') {
            std::cout << "found!" << std::endl;
        }
    }
    return 0;
}
</code>```

Body:
i've been struggling with this problem for quite some time and this is my first for dealing with unicode or UTF-8 basically.

This is what i'm trying to do, I just want to iterate a std::string containing with combination from normal alphabet and a unicode symbol, which in my case is en dash "–". more info: http://www.fileformat.info/info/unicode/char/2013/index.htm

this is the code that i've tried and it won't run:

#include <iostream>
#include <string>

int main()
{
    std::string str = "test string with symbol – and !";
    for (auto &letter : str) {
        if (letter == "–") {
            std::cout << "found!" << std::endl;
        }
    }
    return 0;
}

This is the result of my compiler:

main.cpp: In function 'int main()':
main.cpp:18:23: error: ISO C++ forbids comparison between pointer and
integer [-fpermissive]
     if (letter == "–") {
                   ^

also, when i was looking through the internet i found an interesting information for this type of task that i need to solve. How to search a non-ASCII character in a c++ string?

But when i tried to modified my code with those UTF-8 hex code, it also won't run:

    if (letter == "\xE2\x80\x93") {
        std::cout << "found!" << std::endl;
    }

with the exact same message from my compiler, which is c++ forbids comparison between pointer and integer.

Did i miss something? or do i need to use libraries like ICU or Boost?
Your help is much appreciated. thank you!

Update

based on the answer from UnholySheep, i've been improving my code but it's still cannot work. it can pass the compiling but when i tried to run it, it can't ouput "found!" to out. so, how do i solve this? thank you.

Body:
How about this code?

#include <iostream>
#include <string>

int main()
{
    std::wstring str = L"test string with symbol – and !";
    for (auto &letter : str) {
        if (letter == L'–') {
            std::cout << "found!" << std::endl;
        }
    }
    return 0;
}


问:
How to allow embedded images when sanitizing html with OWASP Java HTML Sanitizer
I would like to allow:

```<code><img src="data:image/jpg;base64,..."/>
</code>```

I see there's documentation on how to do this but I don't understand how to implement it. I tried to add the pattern

```<code>.allowUrlProtocols("data")
.allowAttributes("src").matching(Pattern.compile("$data:image.*")).onElements("img")
</code>```

But that didn't work. I understand the pattern must be a regex expression but I'm not sure I understand how it all links up. I get that it's trying to look for img tags and then looks at the src attribute. My understanding is that it should then look for the string data:image and if finds that allows it through. But that's not happening...

答:
The issue is that I had:

```<code>private static final PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder()
    .allowUrlProtocols("data")
    .allowAttributes("src").matching(ONSITE_OR_OFFSITE_URL).onElements("img")
    .allowAttributes("src").matching(Pattern.compile("^.*data:image/.*$")).onElements("img")
    .toFactory();
</code>```

This caused an issue in that I assumed allowAttribute would combine both. Instead what you have to do is OR the pattern matching (for whatever pattern you want to match) as in:

```<code>Pattern EMBEDDED_IMAGE = Pattern.compile("^.*data:image/.*$")
ONSITE_OR_OFFSITE_URL_OR_EMBEDDED_IMAGE = matchesEither(ONSITE_URL, OFFSITE_URL, EMBEDDED_IMAGE);

private static final PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder()
    .allowUrlProtocols("data")
    .allowAttributes("src").matching(ONSITE_OR_OFFSITE_URL_OR_EMBEDDED_IMAGE).onElements("img")
    .toFactory();
</code>```

This code assumes you're using the EbayPolicyExample

Body:
I would like to allow:

I see there's documentation on how to do this but I don't understand how to implement it. I tried to add the pattern

.allowUrlProtocols("data")
.allowAttributes("src").matching(Pattern.compile("$data:image.*")).onElements("img")

But that didn't work. I understand the pattern must be a regex expression but I'm not sure I understand how it all links up. I get that it's trying to look for img tags and then looks at the src attribute. My understanding is that it should then look for the string data:image and if finds that allows it through. But that's not happening...

Body:
The issue is that I had:

private static final PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder()
    .allowUrlProtocols("data")
    .allowAttributes("src").matching(ONSITE_OR_OFFSITE_URL).onElements("img")
    .allowAttributes("src").matching(Pattern.compile("^.*data:image/.*$")).onElements("img")
    .toFactory();

This caused an issue in that I assumed allowAttribute would combine both. Instead what you have to do is OR the pattern matching (for whatever pattern you want to match) as in:

Pattern EMBEDDED_IMAGE = Pattern.compile("^.*data:image/.*$")
ONSITE_OR_OFFSITE_URL_OR_EMBEDDED_IMAGE = matchesEither(ONSITE_URL, OFFSITE_URL, EMBEDDED_IMAGE);

private static final PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder()
    .allowUrlProtocols("data")
    .allowAttributes("src").matching(ONSITE_OR_OFFSITE_URL_OR_EMBEDDED_IMAGE).onElements("img")
    .toFactory();

This code assumes you're using the EbayPolicyExample


问:
Translate site google API romanian
I am interested in translating my site in Romanian using the google API. Can somebody tell me how I can get the code for Romanian?
I found how to implement it but I don't know I should search to get the code.
Sorry if it is a dumb question , but I'm a beginner.
Thanks, Khoie Aryan.</p>

答:
https://cloud.google.com/translate/docs/languages
Here you can find a list with all the supported languages.
The ISO-639-1 Code for Romanian is simply ro.
GL with your site!</p>

Title: Translate site google API romanian


问:
Azure Postgres: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on
I have an Azure website in development that connects to a new Azure Postgresql database.

This error seemed to have started over the weekend. It was working fine the last time I tried it on Friday. The IP address of my Azure Site Plan seemed to change and I edited the Azure Postgres Firewall rules.

The really weird part is the "0.0.0.0" host. How is the web server looking like IP address "0.0.0.0" to the database? I did add "0.0.0.0" to the firewall as well but that did not have any effect. I of course cannot edit the pg_hba.conf file directly on Azure.

Also, it works fine when running from my dev computer. I tried redeploying my web site, no joy.

Here is the full stacktrace:

```<code>[PostgresException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]
Npgsql.NpgsqlConnector.DoReadMessage(DataRowLoadingMode dataRowLoadingMode, Boolean isPrependedMessage) +310
Npgsql.NpgsqlConnector.ReadMessageWithPrepended(DataRowLoadingMode dataRowLoadingMode) +195
Npgsql.NpgsqlConnector.HandleAuthentication(String username, NpgsqlTimeout timeout) +57
Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout) +299
Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout) +573
Npgsql.NpgsqlConnection.OpenInternal() +366
Npgsql.NpgsqlConnection.Open() +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +120
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +160
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +108
MapHazardsPro4.Functs.GetUserTable() in C:\inetpub\wwwroot\maphazardspro_q3_2017\Functs.vb:539
MapHazardsPro4.Global.Application_Start(Object sender, EventArgs e) in C:\inetpub\wwwroot\maphazardspro_q3_2017\Global.asax.vb:49

[HttpException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]

System.Web.HttpApplicationFactory. EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +10104513
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10085804
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
</code>```

答:
I resolved it the following way:

1: Close all ports inyour psql firewall rules
2: Try connecting(it will fail, of course)
3: From Azure console, open your last postgres server logs file.

Here you should say something like this:

```<code>2017-11-17 08:12:03 UTC-5a0e99d3.713c-LOG:  connection received: host=xxx.xxx.xxx.xxx port=0
2017-11-17 08:12:04 UTC-5a0e99d3.713c-FATAL:  no pg_hba.conf entry for host "0.0.0.0", user "smile", database "smiledb", SSL on
</code>```

Now you can create a rule for the xxx.xxx.xxx.xxx address you saw in the logs, and things should work...
Hope it helps!

Body:
I have an Azure website in development that connects to a new Azure Postgresql database.

This error seemed to have started over the weekend. It was working fine the last time I tried it on Friday. The IP address of my Azure Site Plan seemed to change and I edited the Azure Postgres Firewall rules.

The really weird part is the "0.0.0.0" host. How is the web server looking like IP address "0.0.0.0" to the database? I did add "0.0.0.0" to the firewall as well but that did not have any effect. I of course cannot edit the pg_hba.conf file directly on Azure.

Also, it works fine when running from my dev computer. I tried redeploying my web site, no joy.

Here is the full stacktrace:

[PostgresException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]
Npgsql.NpgsqlConnector.DoReadMessage(DataRowLoadingMode dataRowLoadingMode, Boolean isPrependedMessage) +310
Npgsql.NpgsqlConnector.ReadMessageWithPrepended(DataRowLoadingMode dataRowLoadingMode) +195
Npgsql.NpgsqlConnector.HandleAuthentication(String username, NpgsqlTimeout timeout) +57
Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout) +299
Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout) +573
Npgsql.NpgsqlConnection.OpenInternal() +366
Npgsql.NpgsqlConnection.Open() +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +120
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +160
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +108
MapHazardsPro4.Functs.GetUserTable() in C:\inetpub\wwwroot\maphazardspro_q3_2017\Functs.vb:539
MapHazardsPro4.Global.Application_Start(Object sender, EventArgs e) in C:\inetpub\wwwroot\maphazardspro_q3_2017\Global.asax.vb:49

[HttpException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]

System.Web.HttpApplicationFactory. EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +10104513
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): 28000: no pg_hba.conf entry for host "0.0.0.0", user "UserName", database "orders", SSL on]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10085804
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Body:
I resolved it the following way:

1: Close all ports inyour psql firewall rules
2: Try connecting(it will fail, of course)
3: From Azure console, open your last postgres server logs file.

Here you should say something like this:

2017-11-17 08:12:03 UTC-5a0e99d3.713c-LOG:  connection received: host=xxx.xxx.xxx.xxx port=0
2017-11-17 08:12:04 UTC-5a0e99d3.713c-FATAL:  no pg_hba.conf entry for host "0.0.0.0", user "smile", database "smiledb", SSL on

Now you can create a rule for the xxx.xxx.xxx.xxx address you saw in the logs, and things should work...
Hope it helps!


问:
How to Save an HTML page layout into PDF
I am using core PHP having version 5.1.6 in procedural style

How can i save an HTML page into PDF containing exact layout information?

The major with me at currently that, whenever i am trying to save a_pahe.html to pdf by clicking "Save as PDF" link/button, it saves the HTML page but have lost all the layouts that i have needed.

My exact layout of an HTML page is

And the Generated PDF output is as like this

答: Properly configurated wkhtmltopdf might be what you need for server side pdf rendering.


问:
How do I have python httplib accept untrusted certs?
How do I have python httplib accept untrusted certs?  I created a snake oil/self signed cert on my webserver, and my python client fails to connect as I am using a untrusted cert.

I'd rather problematically fix this in my client code rather than have it trusted on my system.

```<code>import httplib

def main():
    conn = httplib.HTTPSConnection("127.0.0.1:443")
    conn.request("HEAD","/")
    res = conn.getresponse()
    print res.status, res.reason
    data = res.read()
    print len(data)

if __name__ == "__main__":
    main()
</code>```

答:
From inspecting the Python 2.7.14 source code, you may set an environment variable

```<code>PYTHONHTTPSVERIFY=0
</code>```

and this will cause certificate verification to be disabled by default (this will apply to all requests from your program).

I believe this works from 2.7.12+ - but it does not apply to 3.x.

Ref. PEP 493: Verify HTTPS by default, but allow envvar to override that

ContentLicense: CC BY-SA 2.5

Body:
How do I have python httplib accept untrusted certs?  I created a snake oil/self signed cert on my webserver, and my python client fails to connect as I am using a untrusted cert.

I'd rather problematically fix this in my client code rather than have it trusted on my system.

import httplib

def main():
    conn = httplib.HTTPSConnection("127.0.0.1:443")
    conn.request("HEAD","/")
    res = conn.getresponse()
    print res.status, res.reason
    data = res.read()
    print len(data)

if __name__ == "__main__":
    main()

Body:
From inspecting the Python 2.7.14 source code, you may set an environment variable

PYTHONHTTPSVERIFY=0

and this will cause certificate verification to be disabled by default (this will apply to all requests from your program).

I believe this works from 2.7.12+ - but it does not apply to 3.x.

Ref. PEP 493: Verify HTTPS by default, but allow envvar to override that

ContentLicense: CC BY-SA 4.0


问:
NLog custom Target LogCat
I am really struggling to get a basic custom target working with NLog on a Xamarin Android app.

I'd like to create a simple target to LogCat, in order to be able to use a tag so my debug will be easier and more 'human'

LogCatTarget.cs :

```<code>using NLog;
using NLog.Config;
using NLog.Targets;
using Android.Util;

namespace NLog.CustomTarget
{
    [Target("LogCat")]
    public sealed class LogCatTarget : TargetWithLayout
    {
        public LogCatTarget()
        {
            this.Tag = "XamTag";
        }

        //[RequiredParameter]
        public string Tag { get; set; }

        protected override void Write(LogEventInfo logEvent)
        {
            string logMessage = this.Layout.Render(logEvent);

            SendTheMessageToLogCat(this.Tag, logMessage, logEvent.Level);
        }

        private void SendTheMessageToLogCat(string tag, string message, LogLevel level)
        {
            switch (level.Name.ToLower())
            {
                case ("trace"):
                    Log.Verbose(tag, message);
                    break;
                case ("debug"):
                    Log.Debug(tag, message);
                    break;
                case ("info"):
                    Log.Info(tag, message);
                    break;
                case ("warn"):
                    Log.Warn(tag, message);
                    break;
                case ("error"):
                    Log.Error(tag, message);
                    break;
                case ("fatal"):
                    Log.Wtf(tag, message);
                    break;
            }

        }
    }
}
</code>```

in my MainApplication.cs

```<code> void RegisterNlog()
        {

#if DEBUG
            NLog.Common.InternalLogger.LogToConsole = true;
            NLog.Common.InternalLogger.LogFile = "c:\\log.txt";
            NLog.Common.InternalLogger.LogLevel = NLog.LogLevel.Trace;

            //Reference custom Nlog extension for logcat
            Target.Register<NLog.CustomTarget.LogCatTarget>("LogCat");

            var logCatTarget = new NLog.CustomTarget.LogCatTarget();
            logCatTarget.Layout = @"${message}";
            logCatTarget.Tag = "coucou";
            LogManager.Configuration.AddTarget("logcatname", logCatTarget);

            var rule1 = new LoggingRule("*", NLog.LogLevel.Debug, logCatTarget);
            LogManager.Configuration.LoggingRules.Add(rule1);
#endif

        }
</code>```

I also have a NLog.config with a console and a file target which are working fine. (This is why I am adding target and rule and not making a new config)

I launch my app and use a button which call all level of Android.Util.Log and those of Nlog logger

```<code>_butClear.Click += delegate
            {
                _txtDebug.Text = "";

                _logger.Trace("logger test");
                _logger.Debug("logger test");
                _logger.Info("logger test");
                _logger.Warn("logger test");
                _logger.Error("logger test");
                _logger.Fatal("logger test");

                Android.Util.Log.Verbose("XXaaMMM", "logger test");
                Android.Util.Log.Debug("XXaaMMM", "logger test");
                Android.Util.Log.Info("XXaaMMM", "logger test");
                Android.Util.Log.Warn("XXaaMMM", "logger test");
                Android.Util.Log.Error("XXaaMMM", "logger test");
                Android.Util.Log.Wtf("XXaaMMM", "logger test");
            };
</code>```

I put a break point in LogCatTarget.cs on write method, which is ovverided. But I never reach it...

Why ?!!!?  cruel worlddddd ! :)

Thanks for your help.

答:
Rolf Kristensen gave me the answer in comments :

Simply add NLog.LogManager.ReconfigExistingLoggers(); at the end of my RegisterNlog() did the trick !

This is not mentionned in the docs (https://github.com/NLog/NLog/wiki/Configuration-API), or I missed it.

Thanks Rolf !

Title: NLog custom Target LogCat

Body:
I am really struggling to get a basic custom target working with NLog on a Xamarin Android app.

I'd like to create a simple target to LogCat, in order to be able to use a tag so my debug will be easier and more 'human'

LogCatTarget.cs :

using NLog;
using NLog.Config;
using NLog.Targets;
using Android.Util;

namespace NLog.CustomTarget
{
    [Target("LogCat")]
    public sealed class LogCatTarget : TargetWithLayout
    {
        public LogCatTarget()
        {
            this.Tag = "XamTag";
        }

        //[RequiredParameter]
        public string Tag { get; set; }

        protected override void Write(LogEventInfo logEvent)
        {
            string logMessage = this.Layout.Render(logEvent);

            SendTheMessageToLogCat(this.Tag, logMessage, logEvent.Level);
        }

        private void SendTheMessageToLogCat(string tag, string message, LogLevel level)
        {
            switch (level.Name.ToLower())
            {
                case ("trace"):
                    Log.Verbose(tag, message);
                    break;
                case ("debug"):
                    Log.Debug(tag, message);
                    break;
                case ("info"):
                    Log.Info(tag, message);
                    break;
                case ("warn"):
                    Log.Warn(tag, message);
                    break;
                case ("error"):
                    Log.Error(tag, message);
                    break;
                case ("fatal"):
                    Log.Wtf(tag, message);
                    break;
            }

        }
    }
}

in my MainApplication.cs

 void RegisterNlog()
        {

#if DEBUG
            NLog.Common.InternalLogger.LogToConsole = true;
            NLog.Common.InternalLogger.LogFile = "c:\\log.txt";
            NLog.Common.InternalLogger.LogLevel = NLog.LogLevel.Trace;

            //Reference custom Nlog extension for logcat
            Target.Register<NLog.CustomTarget.LogCatTarget>("LogCat");

            var logCatTarget = new NLog.CustomTarget.LogCatTarget();
            logCatTarget.Layout = @"${message}";
            logCatTarget.Tag = "coucou";
            LogManager.Configuration.AddTarget("logcatname", logCatTarget);

            var rule1 = new LoggingRule("*", NLog.LogLevel.Debug, logCatTarget);
            LogManager.Configuration.LoggingRules.Add(rule1);
#endif

        }

I also have a NLog.config with a console and a file target which are working fine. (This is why I am adding target and rule and not making a new config)

I launch my app and use a button which call all level of Android.Util.Log and those of Nlog logger

_butClear.Click += delegate
            {
                _txtDebug.Text = "";

                _logger.Trace("logger test");
                _logger.Debug("logger test");
                _logger.Info("logger test");
                _logger.Warn("logger test");
                _logger.Error("logger test");
                _logger.Fatal("logger test");

                Android.Util.Log.Verbose("XXaaMMM", "logger test");
                Android.Util.Log.Debug("XXaaMMM", "logger test");
                Android.Util.Log.Info("XXaaMMM", "logger test");
                Android.Util.Log.Warn("XXaaMMM", "logger test");
                Android.Util.Log.Error("XXaaMMM", "logger test");
                Android.Util.Log.Wtf("XXaaMMM", "logger test");
            };

I put a break point in LogCatTarget.cs on write method, which is ovverided. But I never reach it...

Why ?!!!?  cruel worlddddd ! :)

Thanks for your help.


问:
How to do a full outer join without having full outer join available
Last week I was surprised to find out that sybase 12 doesn't support full outer joins.
But it occurred to me that a full outer join should be the same as a left outer join unioned with a right outer join of the same sql.
Can anybody think of a reason this would not hold true?</p>

答:
Well first, I don't know why you are using 12.x. It was EndOfLifed on 31 Dec 2009, after having been notified  on 3 Apr 2007.  15.0.2 (first solid version) came out in Jan 2009.  15.5 is much better and was available 02 Dec 2009, so you are two major releases, and over at least 13 months, out of date.

ASE 12.5.4 has the new Join syntax. (you have not specified, you may be on 12.5.0.3, the release prior to that).

DB2 and Sybase did not implement FULL OUTER JOIN, for precisely the reason you have identified: it is covered by LEFT ... UNION ... RIGHT without ALL. It is not a case of "not supporting" a FOJ; it is a case of the keyword is missing.

And then you have the issue that Sybase and DB2 types would generally never use outer joins let alone FOJs, because their databases tend to be more normalised, etc.

Last, there is perfectly ordinary SQL you can use in any version of Sybase that will supply the function of FOJ, and will be distinctly faster on 12.x; only marginally faster on 15.x.  It is kind of like the RANK() function: quite unnecessary if you can write a Subquery.

The second reason it does not need FULL OUTER, as some of the low end engines do, is because the new optimiser is extremely fast, and the query is fully normalised.  Ie. it performs the LEFT and the RIGHT in a single pass.

Depending on you SARGs and DataType mismatches, etc it may still have to sort-merge, but that too is streamed at all three levels: disk I/O subsystem; engine(s); and network handler.  If your tables are partitioned, then it is additionally parallelised at that level.

If your server is not configured and your result set is very large, you may need to increase proc cache size and number of sort buffers.  That's all.


问:
Remove bottom navigation view text in android
I use bottom navigation view for my app and want to remove the text under the icon. I looked for it on the internet but still can't find the solution. Did anyone use to deal with this please give me your solution.

All i want is like this:

My code here:
The main layout contain a recyclerview and a bottomnavigationview:

```<code><LinearLayout
    android:weightSum="10"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.v7.widget.RecyclerView
        android:layout_marginTop="20dp"
        android:layout_weight="8.5"
        android:id="@+id/recyclerview_menu"
        android:layout_width="match_parent"
        android:layout_height="0dp">

    </android.support.v7.widget.RecyclerView>
    <android.support.design.widget.BottomNavigationView
        android:background="@color/whiteColor"
        android:id="@+id/bottom_navigation_bar"
        android:layout_weight="1.5"
        app:menu="@menu/menu_bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="0dp">

    </android.support.design.widget.BottomNavigationView>
</LinearLayout>
</code>```

Here is the bottomnavigation menu:

```<code><menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
    android:id="@+id/action_favorites"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Home"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_schedules"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Search"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_music"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Save"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_me"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Me"
    app:showAsAction="ifRoom" />
</code>```

And in MainActivity:

```<code>    mBottomBar = (BottomNavigationView)
    findViewById(R.id.bottom_navigation_bar);
    disableShiftMode(mBottomBar);

    public void disableShiftMode(BottomNavigationView view) {
    BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
    try {
        Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode");
        shiftingMode.setAccessible(true);
        shiftingMode.setBoolean(menuView, false);
        shiftingMode.setAccessible(false);
        for (int i = 0; i < menuView.getChildCount(); i++) {
            BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
            item.setShiftingMode(false);
            // set once again checked value, so view will be updated
            item.setChecked(item.getItemData().isChecked());
        }
    } catch (NoSuchFieldException e) {
        Log.e("Luan", "Unable to get shift mode field");
    } catch (IllegalAccessException e) {
        Log.e("Luan", "Unable to change value of shift mode");
    }
}
</code>```

答:
Remove titles in menu items.Then apply padding top to bottomnavigationview like below

```<code><menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_favorites"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_schedules"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_music"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_me"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
</code>```

In Bottom navigation view

```<code> <android.support.design.widget.BottomNavigationView
    android:background="@color/whiteColor"
    android:id="@+id/bottom_navigation_bar"
    android:layout_weight="1.5"
    android:paddingTop="16dp"
    app:menu="@menu/menu_bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="0dp">
</code>```

Body:
I use bottom navigation view for my app and want to remove the text under the icon. I looked for it on the internet but still can't find the solution. Did anyone use to deal with this please give me your solution.

All i want is like this:

My code here:
The main layout contain a recyclerview and a bottomnavigationview:

<LinearLayout
    android:weightSum="10"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.v7.widget.RecyclerView
        android:layout_marginTop="20dp"
        android:layout_weight="8.5"
        android:id="@+id/recyclerview_menu"
        android:layout_width="match_parent"
        android:layout_height="0dp">

    </android.support.v7.widget.RecyclerView>
    <android.support.design.widget.BottomNavigationView
        android:background="@color/whiteColor"
        android:id="@+id/bottom_navigation_bar"
        android:layout_weight="1.5"
        app:menu="@menu/menu_bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="0dp">

    </android.support.design.widget.BottomNavigationView>
</LinearLayout>

Here is the bottomnavigation menu:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
    android:id="@+id/action_favorites"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Home"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_schedules"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Search"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_music"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Save"
    app:showAsAction="ifRoom" />
<item
    android:id="@+id/action_me"
    android:enabled="true"
    android:icon="@drawable/ic_search"
    android:title="Me"
    app:showAsAction="ifRoom" />

And in MainActivity:

    mBottomBar = (BottomNavigationView)
    findViewById(R.id.bottom_navigation_bar);
    disableShiftMode(mBottomBar);

    public void disableShiftMode(BottomNavigationView view) {
    BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
    try {
        Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode");
        shiftingMode.setAccessible(true);
        shiftingMode.setBoolean(menuView, false);
        shiftingMode.setAccessible(false);
        for (int i = 0; i < menuView.getChildCount(); i++) {
            BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
            item.setShiftingMode(false);
            // set once again checked value, so view will be updated
            item.setChecked(item.getItemData().isChecked());
        }
    } catch (NoSuchFieldException e) {
        Log.e("Luan", "Unable to get shift mode field");
    } catch (IllegalAccessException e) {
        Log.e("Luan", "Unable to change value of shift mode");
    }
}

Body:
Remove titles in menu items.Then apply padding top to bottomnavigationview like below

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_favorites"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_schedules"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_music"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_me"
android:tittle=""
android:enabled="true"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom" />

In Bottom navigation view

 <android.support.design.widget.BottomNavigationView
    android:background="@color/whiteColor"
    android:id="@+id/bottom_navigation_bar"
    android:layout_weight="1.5"
    android:paddingTop="16dp"
    app:menu="@menu/menu_bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="0dp">