centos7下安裝python3.4的scrapy包
centos7下安裝python3.4的scrapy包
ste0: 切換python版本
[root@localhost lxml]# mv /usr/bin/python2.7.5 /usr/bin/python #切換python版本
step1:安裝依賴包1
[root@localhost opt]# yum -y install libxslt-devel #注意:只能在默認的python2.7下運行
step2:安裝依賴包1
[root@localhost opt]# yum -y install libffi-devel #注意:只能在默認的python2.7下運行
step3:切換python版本
[root@localhost opt]# mv /usr/bin/python2.7.5 /usr/bin/python
[root@localhost bin]# mv /usr/bin/python /usr/bin/python2.7.5
[root@localhost bin]# ln -s /usr/local/bin/python3.4 /usr/bin/python
此時,python默認的版本為python3.4
step4:安裝scrapy
[root@localhost opt]# pip3.4 install scrapy
注意:前面要求setuptools、pip包安裝成功,python3.4安裝時setuptools和pip會默認安裝
step5:查看效果
[root@localhost opt]# pip3.4 freeze
attrs==15.2.0
cffi==1.5.2
cryptography==1.3.1
cssselect==0.9.1
cycler==0.10.0
idna==2.1
lxml==3.6.0
matplotlib==1.5.1
numpy==1.11.0
pyasn1==0.1.9
pyasn1-modules==0.0.8
pycparser==2.14
pyOpenSSL==16.0.0
pyparsing==2.1.1
python-dateutil==2.5.2
pytz==2016.3
queuelib==1.4.2
scipy==0.17.0
Scrapy==1.0.5
service-identity==16.0.0
six==1.10.0
Twisted==16.0.0
w3lib==1.13.0
zope.interface==4.1.3
至於python2.7.5等類似的版本,可以參看:https://www.douban.com/group/topic/51645204/
主要步驟皆為:
1. yum -y install libxslt-devel
2. yum -y install libffi-devel
3. pip install scrapy
http://xxxxxx/Linuxjc/1134371.html TechArticle