First, Python3.6.6 installation
1. Install dependent binary Packages
yum-y Install zlib zlib-devel bzip2 bzip2-devel ncurses ncurses-devel readline readline-devel OpenSSL openssl-devel o Penssl-static xz lzma xz-devel sqlite sqlite-devel gdbm gdbm-devel tk tk-devel gcc gcc-c++
2, put the python-3.6.6.tgz in the/USR/LOCAL/SRC directory
3. Unpack the package
Tar XF python-3.6.6.tgz
4. Enter Python-3.6.6
CD Python-3.6.6
5. Check the Environment configuration
./configure--prefix=/usr/local/python3
6. Compile and install
Make && make install
ln-s/usr/local/python3/bin/python3/usr/bin/python3
7. Add Python3 Environment Variables
vim/etc/profile.d/python3.sh Add the following:
export path= $PATH: $HOME/bin:/usr/local/python3/bin
Reread configuration Files
source/etc/profile.d/python3.sh
View Next version: Python3--version
# Python3--version
Python 3.6.6
Ii. installation of the Scrapy framework
PIP3 Install lxml
PIP3 Install wheel
PIP3 Install scrapy
Third, install selenium, Phantomjs
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
TAR-XVJF phantomjs-2.1.1-linux-x86_64.tar.bz2
cp-r phantomjs-2.1.1-linux-x86_64/usr/local/share/
ln-sf/usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs/usr/local/bin/
PIP3 Install Selenium
Iv. installation of TESSEROCR, PIL
Yum install-y tesseract tesseract-devel leptonica-devel
git clone https://github.com/tesseract-ocr/tessdata.git
MV tessdata/*/usr/share/tesseract/tessdata
pip3 Install TESSEROCR Pillow
Five, Test
>>> Import PIL import Image
>>> from PIL import Image
>>> Import TESSEROCR
>>> p=image.open ('/opt/20180823090940.png ')
>>> S=tesserocr.image_to_text (p)
>>> Print (s)
5890
python3.6.6-based Scrapy environment deployment + image recognition plug-in installation