pip install scrapy 报错:缺少Twisted 解决办法 :error: Microsoft Visual C++ 14.0 is required

报错如下:

报错的最后会显示类似缺少 C++ 14.0之类的

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

但一定要向上看,上面还有一个报错:

building 'twisted.test.raiser' extension
 

前面就不贴了,太多了
Using legacy 'setup.py install' for Twisted, since package 'wheel' is not installed.
Installing collected packages: Twisted, scrapy
    Running setup.py install for Twisted ... error
    ERROR: Command errored out with exit status 1:
     command: 'd:\local\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Huan\\AppData\\Local\\Temp\\pip-install-qnc4hh7u\\twisted\\setup.py'"'"
'; __file__='"'"'C:\\Users\\Huan\\AppData\\Local\\Temp\\pip-install-qnc4hh7u\\twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'
"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Huan\AppData\Local\Temp\pip-record-ddju310m\install-record.txt' --single-version-exte
rnally-managed --compile --install-headers 'd:\local\python38\Include\Twisted'
         cwd: C:\Users\Huan\AppData\Local\Temp\pip-install-qnc4hh7u\twisted\
    Complete output (947 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\twisted
    copying src\twisted\copyright.py -> build\lib.win-amd64-3.8\twisted
    copying src\twisted\plugin.py -> build\lib.win-amd64-3.8\twisted
    copying src\twisted\_version.py -> build\lib.win-amd64-3.8\twisted
    copying src\twisted\__init__.py -> build\lib.win-amd64-3.8\twisted
    copying src\twisted\__main__.py -> build\lib.win-amd64-3.8\twisted
    creating build\lib.win-amd64-3.8\twisted\application
    copying src\twisted\application\app.py -> build\lib.win-amd64-3.8\twisted\application
    ...
    creating build\lib.win-amd64-3.8\twisted\conch
    copying src\twisted\conch\avatar.py -> build\lib.win-amd64-3.8\twisted\conch
    ...
    copying src\twisted\internet\gtk2reactor.py -> build\lib.win-amd64-3.8\twisted\internet
    copying src\twisted\internet\gtk3reactor.py -> build\lib.win-amd64-3.8\twisted\internet
    copying src\twisted\internet\inotify.py -> build\lib.win-amd64-3.8\twisted\internet
    ...
    copying src\twisted\python\test\_deprecatetests.py.3only -> build\lib.win-amd64-3.8\twisted\python\test
    copying src\twisted\trial\test\_assertiontests.py.3only -> build\lib.win-amd64-3.8\twisted\trial\test
    copying src\twisted\words\im\instancemessenger.glade -> build\lib.win-amd64-3.8\twisted\words\im
    copying src\twisted\words\xish\xpathparser.g -> build\lib.win-amd64-3.8\twisted\words\xish
    running build_ext
    building 'twisted.test.raiser' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\local\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Huan\\AppData\\Local\\Temp\\pip-instal
l-qnc4hh7u\\twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\Huan\\AppData\\Local\\Temp\\pip-install-qnc4hh7u\\twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);c
ode=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Huan\AppData\Local\Temp\pip-record-ddju310m\install-
record.txt' --single-version-externally-managed --compile --install-headers 'd:\local\python38\Include\Twisted' Check the logs for full command output.

大概意思就是缺少Twisted文件


解决一:

参考大佬文章:https://blog.csdn.net/qq_36874177/article/details/104457145

在使用python3.8安装Scrapy时,由于无依赖包twisted报错,离线下载其依赖时由于网络十分缓慢,百度发现无3.8版本分享,特意下载后分享。

--------------------------------------------

64位版本:百度网盘分享链接:链接:https://pan.baidu.com/s/1MeH8uzeaLCMfLFN66AUkJg  提取码:nshj

32位版本,百度网盘分享链接:链接:https://pan.baidu.com/s/134fsw0Z8T6LoQg0lhrFK4w  提取码:839r 

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

--------------------------------------------

选择如 Twisted‑19.10.0‑cp38‑cp38‑win_amd64.whl ,其中cp38指的是对应的python3.8版本。

下载完成后在对应目录

pip install Twisted-19.10.0-cp38-cp38-win_amd64.whl 

安装即可。


或者另一个下载地址:https://pypi.org/project/Twisted/#files

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值