安裝scrapy包

安裝scrapy包時遇到了很多麻煩,綜合網上很多文章,最后總結了一個比較通用的方法。
環(huán)境:

  • windows7
  • python2.7.13 x64 新安裝的python沒有其他第三方包

直接使用命令安裝。

 pip install scrapy 

安裝過程中會提示依賴包 lxml 編譯錯誤,去 這里下載對應的編譯好的whl包到本地,安裝lxml后,在安裝scrapy,之后如果遇到其他依賴編譯錯誤,重復上面操作。

pip install lxml?3.7.2?cp27?cp27m?win_amd64.whl
pipinstall scrapy

安裝完畢執(zhí)行命令檢測是否成功。

scrapy --version

顯示錯誤信息,沒有win32api,去上面的網站下載whl包,使用pip安裝出錯,于是去這里下載獨立的exe安裝包,注意版本要兼容python版本的。
安裝完pywin32后在檢測是否安裝成功。

$ scrapy --version
Scrapy 1.3.1 - no active project

Usage:
  scrapy <command> [options] [args]

Available commands:
  bench         Run quick benchmark test
  commands
  fetch         Fetch a URL using the Scrapy downloader
  genspider     Generate new spider using pre-defined templates
  runspider     Run a self-contained spider (without creating a project)
  settings      Get settings values
  shell         Interactive scraping console
  startproject  Create new project
  version       Print Scrapy version
  view          Open URL in browser, as seen by Scrapy

  [ more ]      More commands available when run from project directory

Use "scrapy <command> -h" to see more info about a command

總結是 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 這個網站真好用,早點知道的話,以前裝python的包就不會饒那么多彎路了。

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容