python3.6.6-based Scrapy environment deployment + image recognition plug-in installation

Source: Internet
Author: User
Tags bz2

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.