win7(x64)安裝scrapy框架

Scrapy(官網http://scrapy.org/)是Python開發網絡爬蟲,一個極好的開源工具。本次安裝Scrapy確實不易啊。竟然花了2天多時間,須要的支持包比較多,這些支持包相互之間的依賴關係。php

環境:

Win7專業版(X64) 注:本人從事.net平臺開發,機器上有安裝Vs2010html

Python 2.7.5python

安裝:

  1. install python 
    http://www.python.org/downloads/windows/
  2. add enviroment 
    add C:\Python27 and C:\Python27\scripts in your PATH.
    http://www.nextofwindows.com/how-to-addedit-environment-variables-in-windows-7/
  3. 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
  4. install easy_install 
    https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe#md5=57e1e64f6b7c7f1d2eddfc9746bbaf20

    注意:win7 64位必須使用ez_setup.py進行安裝。方法是下載ez_setup.py後,在cmd下執行 python ez_setup.py,便可自動安裝setuptools。目前沒有直接的exe安裝版本。

  5. install pywin32
     https://pypi.python.org/pypi/setuptools#files 選擇最新的下載
  6. install twisted
    https://pypi.python.org/packages/2.7/T/Twisted/Twisted-13.0.0.win32-py2.7.msi#md5=c2d453a344f56cf6f77204c5769288c0
  7. install zope interface
    https://pypi.python.org/pypi/zope.interface/4.1.0 選擇倒數第二個 zope.interface-4.1.0.win32-py2.7.exe 
  8. install lxml
    lxml-3.3.2.win32-py2.7.exe
  9. 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 pip from https://pip.pypa.io/en/latest/installing.htmlweb

      Now open a Command prompt to check pip is installed correctly:windows

      pip --version 
    • At this point Python 2.7 and pip package manager must be working, let’s install Scrapy:網絡

      pip install Scrapy

問題:

  1. unable to find vcvarsall.bat

    打開「<python安裝目錄>\Lib\distutils\msvc9compiler.py」scrapy

    找到 toolskey = 「VS%0.f0COMNTOOLS」 % version,直接修改成 toolskey = 」VS100COMNTOOLS」 工具

參考:

    1. http://steamforge.net/wiki/index.php/How_to_Install_Scrapy_in_64-bit_Windows_7
    2. http://doc.scrapy.org/en/latest/intro/install.html
相關文章
相關標籤/搜索