安装PIL:
sudo apt-get build-dep python-imaging
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
pip install PIL
或:pip install PIL --allow-external PIL --allow-unverified PIL
如果最后有以下字样,则说明安装PIL成功:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.3 (default, Apr 10 2012, 22:21:37)
[GCC 4.6.3]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
安装tesseract:
sudo apt-get install autoconf automake libtool
sudo apt-get install libpng12-dev
sudo apt-get install libtiff4-dev
sudo apt-get install zlib1g-dev
下载Leptonica源码,编译安装:
./configure
make -j1
sudo make install
下载tesseract源码,编译安装:
./autogen.sh
./configure
make -j1
sudo make install
安装tesseract语言包:
把下载的英语语言包中的eng.traineddata放入/usr/local/share/tessdata目录下。