Win 环境

1 查看本地的python版本:

python -VPython 3.9.8(我本地是)

2 whl形式装置 twisted

  • 1 因为scrapy须要twisted的环境,所以咱们间接去下载whl文件
    依据本人的Python版本在

    https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

    抉择下载

  • 2 下载好后,Twisted‑20.3.0‑cp39‑cp39‑win_amd64.whl,将这个文件寄存到python装置门路下的script文件夹中。
    如下:
  • 3 执行装置

    pip install twisted_iocpsupport-1.0.2-cp39-cp39-win_amd64.whl

    3 装置scrapy

    pip install scrapy

4 装置pywin32

pip install pywin32

5 查看是否装置胜利

scrapy startproject baidu baidu.com

显示相似如下,阐明scrapy 曾经胜利装置

New Scrapy project 'baidu', using template directory 'D:\python398\lib\site-              packages\scrapy\templates\project', created in:  F:\test\baidu.comYou can start your first spider with:  cd baidu.com  scrapy genspider example example.com

Linux 环境

间接 执行 命令:

pip install scrapy