7

So i have been trying to install Scrapy for Python for the last couple of days. Trying anything i could think off and read everything i have come across with similar problems, but haven't been able to find a solution. So here is the code.

Thank you.

building 'twisted.test.raiser' extension
    creating build\temp.win32-3.6
    creating build\temp.win32-3.6\Release
    creating build\temp.win32-3.6\Release\src
    creating build\temp.win32-3.6\Release\src\twisted
    creating build\temp.win32-3.6\Release\src\twisted\test
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 "-Ic:\users\karl holst\appdata\local\programs\python\python36-32\include" "-Ic:\users\karl holst\appdata\local\programs\python\python36-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt" /Tcsrc/twisted/test/raiser.c /Fobuild\temp.win32-3.6\Release\src/twisted/test/raiser.obj
    raiser.c
    c:\users\karl holst\appdata\local\programs\python\python36-32\include\pyconfig.h(222): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command ""c:\users\karl holst\appdata\local\programs\python\python36-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\KARLHO~1\\AppData\\Local\\Temp\\pip-build-ylmjilcy\\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\KARLHO~1\AppData\Local\Temp\pip-hjzcemls-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\KARLHO~1\AppData\Local\Temp\pip-build-ylmjilcy\Twisted\

edit - the code i have used is "pip install Scrapy"

Cœur
  • 37,241
  • 25
  • 195
  • 267
Fony Stark
  • 71
  • 1
  • 1
  • 3
  • If you are using Windows, scrapy recommends using Anaconda/Miniconda and the `conda-forge` channel: see [the installation guide](https://docs.scrapy.org/en/latest/intro/install.html#windows). – paul trmbrth Jun 08 '17 at 13:45
  • As said by @paul trmbrth you should use `conda`. You can refer to this [thread](https://stackoverflow.com/questions/44415065/window-pip-install-scrapy-error-running-build-ext-error-error-5) – Adrien Blanquer Jun 08 '17 at 13:59

5 Answers5

4

I could solve this problem by downloading and installing the latest Windows 10 SDK from this link: https://software-download.microsoft.com/download/pr/19041.685.201201-2105.vb_release_svc_prod1_WindowsSDK.iso

and the basetsd.h file appeared in the following folder:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared

2

I had a very similiar issue involving Scrapy which also failed when it came to the Twisted part of the installation. My answer should still apply to your issue, it involves updating your SDK and making sure your .exe files are in the right location.

Got Scrapy installed in the end perfectly. Hope this helps.

daytony
  • 398
  • 3
  • 9
1

Try after installing Microsoft Visual C++ Compiler for Python 2.7 https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

Rafa0809
  • 1,733
  • 21
  • 24
  • Thank you but i fixed it by downloading anaconda, i dont know how to flag this as solved, but thank you for taking time to solve it. – Fony Stark Jul 24 '17 at 14:25
1

Must have the most recent version of Microsoft Visual C++ Build Tools. In my case it was 2017.

It's like 6GB which is unfortunate because I feel like I get 20MB worth of use from it. But that's what is needed.

It can be downloaded with Visual Studio Installer.

DonkeyKong
  • 1,005
  • 14
  • 18
0

Deployed below components from VC++ installer. Then try pip install pandas. It worked for me.

C++/CLI support for v142 build tools (14.24)

MSVC v140 - VS 2015 C++ build tools (v14.00)

MSVC v141 - VS 2017 C++ ARM build tools (v14.16)

MSVC v141 - VS 2017 C++ ARM64 build tools (v14.16)

MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)

MSVC v141 - VS 2017 C++ x64/x86 Spectre-mitigated libs (v14.16)

C++ 2019 Redistributable Update

C++ Clang Compiler for Windows (9.0.0)

C++ Clang-cl for v142 build tools (x64/x86)

C++ CMake tools for Windows

C++ Modules for v142 build tools (x64/x86 – experimental)

Durai
  • 9
  • 1