centos6.5 部署scrapy环境

匿名 (未验证) 提交于 2019-12-03 00:33:02

一. 升级python

下载python最新版本2.7.13并编译安装

1
2
3
4
5
6
7
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.13.tar.xz
xz -d Python-2.7.13.tar.xz
tarxf Python-2.7.13.tar
cdPython-2.7.13
./configure--prefix=/usr/local/python-2.7.13
make
makeinstall


Python-2.7.13 会安装在 /usr/local/python-2.7.13 目录下

系统自带的 Python 是在 /usr/bin 目录下

1
2
3
4
5
6
7
ll -tr/usr/bin/python*
/usr/bin/python2.6-config
/usr/bin/python2.6
/usr/bin/python
/usr/bin/python2-> python
/usr/bin/python-config-> python2.6-config


更新系统默认 Python 版本
备份旧的python

1
2
3
4
5
6
mv/usr/bin/python/usr/bin/python2.6.6
mv/usr/bin/python-config/usr/bin/python2.6-config
ln/usr/local/python-2.7.13/bin/python2/usr/bin/python
ln/usr/local/python-2.7.13/bin/python-config/usr/bin/python-config
ln/usr/local/python-2.7.13/bin/python2/usr/bin/python2.7


查看新的 Python 版本

1
2
python --version
Python 2.7.13

修改yum
vim /usr/bin/yum
将开头的python改成python2.6
二.
为新版 Python 安装 setuptools

1
2
3
4
5
6
7
8
9
10
11
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
curl -O -L https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0
unzip setuptools-36.0.1.zip#md5\=430eb106788183eefe9f444a300007f0
cdsetuptools-36.0.1
install
ln/usr/local/python-2.7.13/bin/easy_install/usr/bin/easy_install
/usr/local/python-2.7.13/bin/easy_installpip
ln/usr/local/python-2.7.13/bin/pip/usr/bin/pip
pip list


接下来就可以用pip来安装软件了

三.



Twisted-15.5.0

四.

1.pip install scrapy

2 pip install scrapyd-client


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!