Various problems and solutions for installing Django simple CAPTCHA under Windows and Linux

Source: Internet
Author: User

Reprinted from Http://www.cnblogs.com/descusr/p/3225874.html

After all the program has been written, the verification code image is not displayed, click on the image address will mention the following error, and the correct method under Linux

generate verification code with PIL: Importerror:the _imagingft C module is not installed

This is because PIL did not compile freetype caused by
View lib/python2.7/site-packages/pil/
See if _imagingft.so exists (it's important to know if the system includes 2.6 or 2.7 version numbers)

# need to install the JPEG library
wget http://www.ijg.org/files/ JPEGSRC.V7.TAR.GZ
TAR-ZXVF jpegsrc.v7.tar.gz
CD jpeg-7
cc= "Gcc-arch x86_64"
./configure--enable-shared--enable-static
MAKE
make install
# then install PIL library
< Span style= "margin:0px; padding:0px; line-height:1.5 "> Let PiL support FreeType method

1, install FreeType Development library
yum Install freetype-devel

2, download source http://effbot.org /downloads/imaging-1.1.7.tar.gz

3, change setup.py file
change

jpeg_root = Libinclude ("/usr/local ")
freetype_root = '/usr/lib64 ', '/usr/include/freetype2/freetype '

4 , view support items
python setup.py build_ext -I
---FREETYPE2 support available  Note This item

5, compile and install
python setup.py Install

If the above settings fail, then only the following killer can be found:

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-u PIL

When the following prompt is present, the installation is successful:
PIL1.1.7SETUP SUMMARY--------------------------------------------------------------------version1.1.7Platform Linux22.7.3(Default, APRTen  -, A: +:Panax Notoginseng) [GCC4.6.3]-----------------------------------------------------------------------TKINTER Support Available---JPEG Support Available---ZLIB (png/ZIP) Support available---FREETYPE2 Support Available***littlecms Support not available

Under Windows
No matter how the installation is wrong, you must change the Python to 32-bit from the beginning
For the above error, install pillow-2.4.0.win32-py2.7 directly
And then the whole world is quiet.

Various problems and solutions for installing Django simple CAPTCHA under Windows and Linux

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.