当前位置: > 数据库 > Redis >

centos7安装python,pip,redis,lxml

时间:2016-06-04 15:17来源:linux.it.net.cn 作者:IT
首先安装必要的库

  1. yum -y install gcc
  2.  
  3. yum install mysql mysql-devel mysql-lib
  4.  
  5. yum install python-devel 

 

安装redis:


  1. yum -y install redis

 

安装python相关工具:

安装setuptools


  1. wget http://pypi.douban.com/packages/source/s/setuptools/setuptools-5.7.zip
  2.  
  3. cd setuptools-5.7
  4.  
  5. python setup.py build
  6.  
  7. python setup.py install
  8.  
  9. make
  10.  
  11. make install
 

 

安装pip: 


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

 

安装python mysql


  1. pip install MySQL-python

 

安装lxml 


  1. 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



 

(责任编辑:IT)
------分隔线----------------------------