Scrapy(官网http://scrapy.org/)是Python开发网络爬虫,一个极好的开源工具。本次安装Scrapy确实不易啊。居然花了2天多时间,需要的支持包比较多,这些支持包相互之间的依赖关系。
环境:
Win7专业版(X64) 注:本人从事.net平台开发,机器上有安装Vs2010。
Python 2.7.5
安装:
-
install python
http://www.python.org/downloads/windows/ -
add enviroment
add C:\Python27 and C:\Python27\scripts in your PATH.
http://www.nextofwindows.com/how-to-addedit-environment-variables-in-windows-7/ -
install OpenSSL
http://slproweb.com/products/Win32OpenSSL.html download Visual C++ 2008 Redistributables and Win64 OpenSSL v1.0.1f
add C:\OpenSSL-Win64\bin in your PATH -
install easy_install
https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe#md5=57e1e64f6b7c7f1d2eddfc9746bbaf20 -
install pywin32
https://pypi.python.org/pypi/setuptools#files 选择最新的下载
-
install twisted
https://pypi.python.org/packages/2.7/T/Twisted/Twisted-13.0.0.win32-py2.7.msi#md5=c2d453a344f56cf6f77204c5769288c0 -
install zope interface
https://pypi.python.org/pypi/zope.interface/4.1.0 选择倒数第二个 zope.interface-4.1.0.win32-py2.7.exe -
install lxml
lxml-3.3.2.win32-py2.7.exe -
install pyopenssl
http://www.egenix.com/cryptodownload/?file=egenix-pyopenssl-0.13.0_1.0.0g_1.win-amd64-py2.7.msi(重点)
安装完成后,在python中输入import OpenSSL 无错则安装成功 -
install scrapy
http://scrapy.org/download/ 建议下载tarball,cd 到下载目录,然后setup.py install
问题:
- unable to find vcvarsall.bat
打开“<python安装目录>\Lib\distutils\msvc9compiler.py”
找到 toolskey = “VS%0.f0COMNTOOLS” % version,直接修改为 toolskey = ”VS100COMNTOOLS”