centos7安装python,pip,redis,lxml

首先安装必要的库

 

1
2
3
4
5
yum -y install gcc

yum install mysql mysql-devel mysql-lib

yum install python-devel

 

 

 

 

安装redis:

1
yum -y install redis

 

 

安装python相关工具:

安装setuptools

1
2
3
4
5
6
7
8
9
10
11
wget http://pypi.douban.com/packages/source/s/setuptools/setuptools-5.7.zip

cd setuptools-5.7

python setup.py build

python setup.py install

make

make install

 

 

安装pip:

1
easy_install -i http://pypi.douban.com/simple pip

 

 

安装python mysql

1
pip install MySQL-python

 

 

安装lxml

1
2

yum install -y python-lxml

 

 

 

测试:

[root@zouhongzhao spider]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import lxml
import MySQLdb
import redis

ok

 

坚持原创技术分享,您的支持将鼓励我继续创作!