Scrapy安装错误:Microsoft Visual C++ 14.0 is required

近日,在安装Scrapy的时候提示出现了如下的错误信息:

Scrapy安装错误:Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

导致Scrapy没有安装成功,安装的环境是:当前环境win7,python_3.6.1,64位。windows环境下,在cmd中运行pip install Scrapy报错。往上面查询安装的情况显示的是:

Best match: Twisted 17.9.0
Processing Twisted-17.9.0.tar.bz2
Writing C:\Users\ghr\AppData\Local\Temp\easy_install-q6ar7s9q\Twisted-17.9.0\setup.cfg
Running Twisted-17.9.0\setup.py -q bdist_egg --dist-dir C:\Users\ghr\AppData\Local\Temp\easy_install-q6ar7s9q\Twisted-17.9.0\egg-dist-tmp-d7wibfjn
warning: no previously-included files matching '*.misc' found under directory 'src\twisted'
warning: no previously-included files matching '*.bugfix' found under directory'src\twisted'
warning: no previously-included files matching '*.doc' found under directory 'src\twisted'
warning: no previously-included files matching '*.feature' found under directory 'src\twisted'
warning: no previously-included files matching '*.removal' found under directory'src\twisted'
warning: no previously-included files matching 'NEWS' found under directory 'src\twisted'
warning: no previously-included files matching 'README' found under directory 'src\twisted'
warning: no previously-included files matching 'newsfragments' found under directory 'src\twisted'
warning: no previously-included files found matching 'src\twisted\topfiles\CREDITS'
warning: no previously-included files found matching 'src\twisted\topfiles\ChangeLog.Old'
warning: no previously-included files found matching 'pyproject.toml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching 'bin'
no previously-included directories found matching 'admin'
no previously-included directories found matching '.travis'
warning: no previously-included files found matching 'docs\historic\2003'
warning: no previously-included files matching '*' found under directory 'docs\historic\2003'

显然是Twisted 17.9.0没有安装成功导致的

解决办法:http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下载twisted对应版本的whl文件(如我的Twisted‑17.9.0‑cp36‑cp36m‑win_amd64.whl),cp后面是python版本,amd64代表64位,运行命令:

pip install F:\AI\python\Twisted-17.9.0-cp36-cp36m-win_amd64.whl  

install后面为下载的whl文件的完整路径名,安装成功后提示:Successfully installed Twisted-17.9.0

运行下面命令:pip install Scrapy

出现:Installing collected packages: pyasn1, pyasn1-modules
Successfully installed pyasn1-0.4.2 pyasn1-modules-0.2.1    安装成功,在cmd命令行输入scrapy出现如下:

Usage:
  scrapy [options] [args]

Available commands:
  bench         Run quick benchmark test
  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 -h" to see more info about a command

代表安装成功了!

你可能感兴趣的:(Scrapy)