玩爬虫怎么能少得了pyspider这个神扩展,可是由于博主习惯(没钱买mac,用不惯linux)用windows作为开发环境,在安装pyspider的时候居然报错了,我们来看看pyspider的官方解释吧:
Does pyspider Work with Windows?
Yes, it should, some users have made it work on Windows. But as I
don’t have windows development environment, I cannot test. Only some
tips for users who want to use pyspider on Windows:
(作者坚定的说必须能用,但是他没有windows开发环境,没法测试,只能给大家一些提示)
-Some package needs binary libs (e.g. pycurl, lxml), that maybe you
cannot install it from pip, Windowns binaries packages could be found
in http://www.lfd.uci.edu/~gohlke/pythonlibs/.
(有些包需要用到二进制库文件,比如pycurl,lxml这些的,所以不能在windows底下直接用pip安装,点击那个链接去下载这些包)
- Make a clean environment with virtualenv
(使用virtualenv虚拟环境)
- Try 32bit version of Python, especially your are facing crash issue. Avoid using Python 3.4.1 (#194, #217)
(使用32位的python,尽量不要使用python3.4.1)
看到这基本应该没问题了,按照指示,点击链接去下载二进制库,文件格式 是.whl,然后命令行切换到二进制库下载的路径,使用pip install XXXX.whl把这所需的二进制文件安装好之后再使用pip install pyspider,这次就刷刷刷的装好了。然后运行pyspider,OK,成功启动。搞定!