解决Python3 – Scrapy安装失败,错误代码:error: Microsoft Visual C++ 14.0 is required

Python 做棵大树 6年前 (2018-10-24) 2811次浏览 1个评论

问题:win10 64 位 使用 pip 安装 Scrapy 时,安装失败,报如下错误

building ‘twisted.test.raiser’ extension
error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools

这个错误报告很人性化,它不仅给出了你的错误,还给出了明确的解决方案。我初看到时候,也是这个感觉,直接 download 不久可以了嘛。

但是,当我点击链接 http://landinghub.visualstudio.com/visual-cpp-build-tools 时候,发现 404

页面是这个样子的:

解决 Python3 - Scrapy 安装失败,错误代码:error: Microsoft Visual C++ 14.0 is required

所以就去网上搜寻了解决方案:

解决方案:

1、手工下载 twisted 的 whl 文件进行安装;

下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 

根据自身的 python 版本和系统的位数进行选择下载

如果不知道的话,可以在 命令行 中输入命令

python

<a href="https://beatree.cn/tag/python" title="查看更多关于 Python 的文章" target="_blank">Python</a> 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

根据上边的信息我就知道我的电脑是Python 3.7 的,然后是 64 位系统,所以我就选择了 Twisted‑18.9.0‑cp37‑cp37m‑win_amd64.whl

2、然后再 命令行 中先安装你下载的文件  pip install 路径+文件名

3、pip install scrapy


做棵大树 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明解决 Python3 – Scrapy 安装失败,错误代码:error: Microsoft Visual C++ 14.0 is required
喜欢 (1)
[欢迎投币]
分享 (0)
关于作者:
一个整天无所事事的,有时候忽然热血的孩子
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. 安装好scrapy后,再运行项目后发现报错:ModuleNotFoundError: No module named 'win32api'
    这是因为缺少文件,在cmd下执行命令pip install pypiwin32安装完成后即可消除错误
    做棵大树2018-10-24 21:06 回复 Windows 10 | Firefox浏览器 64.0