Windows 10 Python3.7下安装scrapy框架

首先是安装Python, 对应自己的OS版本

官网下载地址:Python,一般选择Windows x86-64 executable installer。

安装scrapy for Windows

升级pip,避免安装过程中出现报错pip版本太低

python -m pip install --upgrade pip

安装wheel

pip install wheel

下载Lxml、Twisted、Pywin32

温馨提示:在浏览器上可以通过ctrl+f打开页面搜索框,然后输入你要查找的关键字即可;对于Lxml、twisted,cp37对应py3.7,自行选择32 or 64位,没有3.7就用3.6也行。

由于我电脑是64位,Python是3.7.x,所有我下载的是lxml‑4.2.5‑cp37‑cp37m‑win_amd64.whl

由于我电脑是64位,Python是3.7.x,所有我下载的是Twisted‑18.9.0‑cp37‑cp37m‑win_amd64.whl

由于我电脑是64位,Python是3.7.x,所有我下载的是pywin32-221.win-amd64-py3.7.exe

安装Lxml、Twisted、Pywin32

  • 安装Lxml、Twisted的命令格式:pip install 文件路径
pip install D:\Downloads\Twisted‑18.9.0‑cp37‑cp37m‑win_amd64.whl
  • 安装Pywin32就很简单了,双击下载的exe文件,直接一路next即可,傻瓜式安装。

安装scrapy

  • 输入如下命令,等待几分钟即可安装完成
pip install scrapy
  • 验证安装结果
scrapy

输出结果如下则表明安装成功:

C:\Users\Administrator>scrapy
Scrapy 1.5.1 - no active project

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

Available commands:
  bench         Run quick benchmark test
  fetch         Fetch a URL using the Scra
  genspider     Generate new spider using
  runspider     Run a self-contained spide
  settings      Get settings values
  shell         Interactive scraping conso
  startproject  Create new project
  version       Print Scrapy version
  view          Open URL in browser, as se

  [ more ]      More commands available wh

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

C:\Users\Administrator>

至此,Windows 10 Python3.7下安装scrapy框架教程已结束。

猜你喜欢

转载自blog.csdn.net/u013902368/article/details/85257986