Introduction to the practical application solution and code of the Python Environment

Source: Internet
Author: User

If you are interested in the Python environment, you can read the following articles to learn more about the Python environment, this article is a detailed introduction to its practical application solutions. The following is a detailed introduction to this article. I hope you will gain some benefits.

Download the Python source code, decompress it, compile and install it without special operations.

Install sh setuptools-0.6c11-py2.6.egg installation related Packages

 
 
  1. easy_install DBUtils  
  2. easy_install flup  
  3. easy_install web.py 

The installation of mysql-pythonmysql-python package cannot be installed with easy_install. Specify the path of mysql_config. Note that it is the path of the newly installed mysql package.

 
 
  1. mysql_config=/usr/local/mysql/bin/mysql_config 

Compilation and Installation

 
 
  1. python setup.py build  
  2. python setup.py install 

Declare libmysqlclient path

 
 
  1. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib 

3. download and install the fastcgi header file in the Installation server environment, decompress the file by default, compile and install PCRE, and specify-prefix =/usr/local/lighttpd for compiling and installing lighttpdconfigure by default.

4. Configuration

For details about how to run the web. py program in lighttpd fastcgi, refer to the Important Notes: The python script running through fastcgi must have the executable permission,

 
 
  1. chmod u+x web/main.py; 

To restart the fastcgi program, you need to delete/tmp/fastcgi. socket *. The above content is a detailed introduction to the Python environment's actual application solution.

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.