centos7安装python,pip,redis,lxml
时间:2016-06-04 15:17 来源:linux.it.net.cn 作者:IT
首先安装必要的库
-
yum -y install gcc
-
-
yum install mysql mysql-devel mysql-lib
-
-
yum install python-devel
安装redis:
-
yum -y install redis
安装python相关工具:
安装setuptools
-
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:
-
easy_install -i http://pypi.douban.com/simple pip
安装python mysql
-
pip install MySQL-python
安装lxml
-
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)
首先安装必要的库
安装redis:
安装python相关工具: 安装setuptools
安装pip:
安装python mysql
安装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 |