安装Scrapy错误时出错:需要Microsoft Visual C++ 14.0

P.h*_*ter 5 python scrapy

我发现scrapy是一个很好的工具刮,所以我试图在我的机器上安装scrapy,但是当我试着pip install scrapy安装一段时间并把它扔给我这个错误..

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Run Code Online (Sandbox Code Playgroud)

我试图在虚拟环境中安装它,但问题仍然存在.

编辑:这是我错误后得到的..

    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command "d:\pycharmprojects\environments\scrapyenv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-arbeqlly\\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\User\AppData\Local\Temp\pip-jdj93131-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\pycharmprojects\environments\scrapyenv\include\site\python3.5\Twisted" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-arbeqlly\Twisted\
Run Code Online (Sandbox Code Playgroud)

任何帮助?

P.h*_*ter 9

我通过从这里安装工具解决了这个问题

问题是一些python模块需要C++工具来编译python包装器,因为它们是用C++编写的.

下载设置后,您可以选择特定工具或下载提供的其他设施.

它大约是4 GB,但如果将来你需要使用一些用C++制作的其他模块,那么就可以解决这个问题.


小智 6

使用Conda安装

如果您有conda,请使用:conda install -c anaconda scrapy

要么

使用pip安装

在此位置下载https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted pip install Twisted-18.9.0-cp27-cp27m-win_amd64.whl pip install scrapy

  • 下载 Twisted 文件并使用 pip 安装它对我来说绝对是最快和最简单的解决方案 (3认同)