Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error C1083: Cannot open include file: 'basetsd.h'

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"

like image 872
Fony Stark Avatar asked Oct 18 '22 11:10

Fony Stark


2 Answers

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.

like image 108
daytony Avatar answered Oct 31 '22 10:10

daytony


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

like image 31
Rafa0809 Avatar answered Oct 31 '22 11:10

Rafa0809