第1.2章 scrapy之python2中scrapy安装

python版本采用3.5.2,执行pip install scrapy,会提示error: Unable to find vcvarsall.bat的错误,黄色的内容是pip的版本低了,那么可以执行
python -m pip install --upgrade pip进行升级
异常
python3.5在windows环境依赖于VS2015,而VS2015是For Win10的,在Win7上装不了。python3.4在windows环境依赖于VS2013,VS2013要求Win7打补丁。仔细想想为什么要升级python,还要依赖于VS的环境,费劲,很多linux、mac默认安装的都是python2的版本,科学家使用python做计算很多年了,他们不专注于算法,难道不断跟着升级python,意义何在?最终选择python的版本是2.7.12,我只需要python完成我想干的事情就可以了,至于所谓的中文解析缺陷,可以有其他的手段可以弥补。
执行进入scrapy目录,执行python setup.py install,出现以下异常:
异常2
make sure the development packages of libxml2 and libxslt are installed
按照lxml中说明安装lxml,用于xml的解析.
lxml安装
再次执行python setup.py install,提示错误
error: The 'pyasn1' distribution was not found and is required by service-identity
执行pip install pyasn1后,再次安装scrapy,提示异常

build\temp.win32-2.7\Release\_openssl.c(433) : fatal error C1083: Cannot open in
clude file: 'openssl/opensslv.h': No such file or directory
error: [Error 5] : 'c:\\users\\dzm\\appdata\\local\\temp\\easy_install-wv1jmv\\c
ryptography-1.5.2\\.eggs\\cffi-1.8.3-py2.7-win32.egg\\_cffi_backend.pyd'

执行命令pip install cryptography,安装加密模块
再次安装scrapy,终于安装成功
scrapy
通过执行python -c "import scrapy;print(scrapy.__version__)" 这个语句可以查看任意插件的版本,比如numpy、pandas,都是一样的
根据上面过程总结,如下

  1. scrapy的下载地址
  2. 安装lxml
  3. 安装pyasn1
  4. 安装cryptography
  5. 最后安装scrapy
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

warrah

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值