Note that I stumbled a little with the introduction of TRML2PDF, a library that generates PDF with Python.
environment: MacOSX(10.11.6 El Capitane) Python2.7.x (pyenv environment for convenience)
Introduced pip and homebrew
#Library that handles jpeg
brew install jpeg
#Python image processing library
pip install pillow
#Python PDF generation library
pip install trml2pdf
Is OK.
See below. TRML2PDF https://github.com/romanlv/trml2pdf/
As written in the README
pip install trml2pdf
If so
ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
It has become. Explicitly add an option to disable jpeg. If you read a little more, you need a library called Pillow to use TRML2PDF, so you're getting an error while installing it.
pip install pillow
...
ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
I'm getting the same error as a matter of course because I'm getting an error while installing Pillow. Anyway, I found that the cause was that the Pillow installation failed.
According to the investigation, when trying to handle jpeg with Pillow, a library called libjpeg that encodes and decodes jpeg is required. How. https://ja.wikipedia.org/wiki/Libjpeg
Install libjepg with homebrew
brew install jpeg
Install Pillow with pip again
pip install pillow
Install TRML2PDF with pip again
pip install trml2pdf
It's fine from the interpreter, so let's import it.
python
Python 2.7.2 (default, Nov 25 2016, 09:30:37)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import trml2pdf
>>>
Looks good!
Recommended Posts