报错如下:
报错的最后会显示类似缺少 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