Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing Scrapy error: Microsoft Visual C++ 14.0 is required

Tags:

python

scrapy

I found about scrapy that is a great tool scraping so i tried to install scrapy on my machine, but when i tried to do pip install scrapy it installed for a while and threw me this error..

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

I tried to install it in virtual environment but still the problem persists.

EDIT: here is what i got after the error..

    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\

any help?

like image 1000
P.hunter Avatar asked Apr 14 '17 10:04

P.hunter


People also ask

How do I fix Microsoft Visual C++ 14.0 required error?

Install the Latest Microsoft Visual Studio Installer. Sometimes, the “error: Microsoft Visual C++ 14.0 is required” can occur due to the Visual Studio installer getting corrupted or outdated. In this case, you can try using the latest Microsoft Visual Studio installer.

How do I fix Microsoft Visual C++ redistributable package installation failed?

The Microsoft Visual C++ installation error might be caused by corrupted registry keys. In this case, the Microsoft Program Install and Uninstall troubleshooter could resolve the issue. The Microsoft Program Install and Uninstall Troubleshooter will scan and repair corrupted registry keys.


3 Answers

Install Using Conda

If you have conda Use: conda install -c anaconda scrapy

Or

Install Using pip

Download https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted at this location

//Download the whl file of same version as Python version here cp27 means python2.7
pip install Twisted-18.9.0-cp27-cp27m-win_amd64.whl 
pip install scrapy
like image 107
Sameer Kumar Choudhary Avatar answered Nov 01 '22 08:11

Sameer Kumar Choudhary


but the question is what does scrapy has to do with visual studio

Some python modules require a C/C++ compiler to build. That's why you need Visual Studio.

Quoting from Scrapy Installation Guide:

some binary packages that Scrapy depends on (like Twisted, lxml and pyOpenSSL) require a compiler available to install, and fail if you don’t have Visual Studio installed.

like image 24
Chankey Pathak Avatar answered Nov 01 '22 08:11

Chankey Pathak


UPDATE As some one pointed out in the edit, if you download only the vc_redist.x64.exe it's just 15MB, for that go to "other tools and frameworks" and choose MS Visual C++

solved the problem by installing the tools from here

the thing is that some python modules require C++ tools to compile with a python wrapper around, as they are written in C++.

once the setup is downloaded you can select the specific tools or download other facilities provided.

it's somewhere around 4 GB but solves the purpose if in future you need to use some other module which are made in C++.

like image 9
P.hunter Avatar answered Nov 01 '22 09:11

P.hunter