The latest version of TESSERACT-OCR 3.0.4 needs to run above the python2.7 version, so you need to upgrade the default version of 2.6 Python and Mod_wsgi in the system
1, download and install Python-2.7.10
>tar xjvf python-2.7. Ten. Tar6.xz>cd python-2.7. Here, you must use –enable-shared to generate a dynamic library, or you will encounter problems that WSGI cannot compile. >./configure--enable-shared >make make-install
#替换原来的默认python
>mv/usr/bin/python/usr/bin/python2.6
>ln-s/usr/local/bin/python2.7/usr/bin/python
#设置lib路径
>ldconfig/usr/local/lib
#查看python状态
>python-v
2, install the python2.7 Mod_wsgi
Install Mod_wsgi
If the--enable-shared parameter is not added when installing python2.7.10, the following error is reported when installing MOD_WSGI:"recompile with-fpic"
......
/USR/BIN/LD:/usr/local/lib/libpython2.7.a (ABSTRACT.O): Relocation r_x86_64_32 against '. rodata.str1.8 ' can not is used When making a shared object; Recompile with-fpic
/usr/local/lib/libpython2.7.a:could not read Symbols:bad value
Collect2:ld returned 1 exit status
Apxs:Error:Command failed with rc=65536
3, replace the system default Mod_wsgi
>mv /usr/lib64/httpd/modules/mod_wsgi.so/usr/lib64/httpd/modules/>ln -s/usr/ Local/lib/python2. 7/site-packages/mod_wsgi/server/mod_wsgi-py27.so/usr/lib64/httpd/modules/mod_wsgi.so
4, run Apache, error can not find the OCR module, however in the debugging environment no problem, after viewing PYOCR source discovery, Pyocr.get_available_tools () is through the environment variable os.environ["PATH" To see if there is a tesseract command, you need to add Tesseract's installation path/usr/local/bin/tesseract to path and then reboot, or join the path yourself in the Python program/usr/local/bin
CentOS 6 Installation Python 2.7 and Mod_wsgi run Pyocr[tesseract]