Scrapy Crawler error No module named PIL + ioerror:decoder JPEG not available installation

Source: Internet
Author: User

Scrapy encountered an error, found less than one packet pil.

PIL's download address.

Tar zxvf imaging-1.1.7.tar.gz

CD Imaging-1.1.7

Python setup.py Install

--------------------------------------------------------------------------------------------------------------


_______________________________________________________________________________________________________________ ___

The JPEG library and FreeType2 library installed under Ubuntu

$ su Root

Root $ apt-get Install Libjpeg-dev

Root $ apt-get Install Libfreetype6-dev

$tar ZXVF imaging-1.1.7.tar.gz

$CD Imaging-1.1.7

$python setup.py Install


--------------------------------------------------------------------------------------------------------------- --

Install Freetype2

The first step: Download

The second step: decompression

The following error occurred in the installation./configure


Analysis that this file is written in Windows, so after each line will add a ctrl+m is ^m, so the rear of the SH will become sh^m of course there is no such command, so the script can not run, the ^m removed should be no problem.

$vi Configure

VI opened and found the end of each line added ^m

"

first, the use of VI editor, VI is a UNIX-like system under the powerful editor, using VI, you can solve a lot of problems for us:

1. VI filename

2. Press ESC

3. Enter the following string:%s/^m//g (Note that ^m = Ctrl V + CTRL M instead of manually enter ^m)

4. Direct return Enter (^m clean successfully)

5.: wq! (Save exit)

second, the use of CAT+TR to generate new files, and then use MV command to overwrite the original file:

cat-v Original Document | tr-d "^m" > New file

MV New File original document

iii. using the SED tool:

sed ' s/^m//original file > New document

MV New File original document

Note: The ^m in one or 32 methods are created after the ctrl+m of CTRL + V, which is a separate character, and the second can be generated directly shift+6 the letter M.

"

I used the first method.


Download Libjpeg,

Jpegsr6.zip

Extract files:

$ unzip Jpegsr6.zip

$CD jpeg-6b

first, the use of VI editor, VI is a UNIX-like system under the powerful editor, using VI, you can solve a lot of problems for us:

1. VI Configure

2. Press ESC

3. Enter the following string:%s/^m//g (Note that ^m = Ctrl V + CTRL M instead of manually enter ^m)

4. Direct return Enter (^m clean successfully)

5.: wq! (Save exit)

$./configure--prefix=/usr/local/jpeg

If you add this sentence [--enable-shared--enable-static], the following error occurs when make

$make


Problems with the two files in the main source code file, Config.guess config.sub

$ RM config.guess

$RM config.sub

Unexpectedly deleted, need two files to replace, these two files under/usr/share/libtool/config {Notice the point behind.}

$CP/usr/share/libtool/config/config.guess.

$CP/usr/share/libtool/config/config.sub.

The above four steps, sometimes need to operate more than a few times before you can.

$./configure--prefix=/usr/local/jpeg

——————————————————— Method 2---------------------------------------------------------

PIL's download address.

$ tar zxvf imaging-1.1.7.tar.gz

$ CD Imaging-1.1.7

Edit setup.py File


Where the path is the libjpeg.so path

Test whether the compilation succeeded

$python setup.py build_ext-i

$python selftest.py

If the entire process is not wrong, install

$ python setup.py Install


Related Article

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.