在Windows下安装scrapy

来源:互联网 发布:印象笔记 圈点 mac 编辑:程序博客网 时间:2024/06/04 18:43

今天在安装这个框架时候遇到好多麻烦,最后查了一些帖子后突然成功了,我的是版本是win10。首先把成功的步骤记录下来:

  1. 首先在windows下安装:VCForPython27,这个一路next就可以。具体的原理请看帖子:Hisheng.
  2. 然后打开Windows下面的powershell,输入pip install scrapy。界面显示:Successfully installed asn1crypto-0.22.0 cffi-1.10.0 cryptography-1.9 enum34-1.1.6 idna-2.5 ipaddress-1.0.18 pyasn1-0.2.3 pycparser-2.17 , 这样就大功告成了。安装成功scrapy。

现在记录所遇到的各种错误:

  1. 在windows下的powershell下直接输入pip install scrapy会遇到错误:C++9 required..., 解决办法就是安装VCForPython27。
  2. 在Ubuntu下安装scrapy主要错误是error: command 'i686-linux-gnu-gcc' failed with exit status 1,这个问题网上的解决办法是在终端中输入sudo apt-get install python-dev,但是在我自己的在虚拟机上的Ubuntu中没有成功。这方面有安装成功的帖子http://jingyan.baidu.com/article/f3ad7d0f129c7809c2345b56.html。
  3. 在windows下通过下载scrapy文件然后在powershell中输入python setup.py install无法安装成功,即使是安装了VCForPython27之后也同样出现这个错误。

参考:
http://www.cnblogs.com/hisheng/p/5968841.html
https://stackoverflow.com/questions/27017381/error-command-i686-linux-gnu-gcc-failed-with-exit-status-1-while-installing-p

原创粉丝点击