title: Running Cython in Windows x64 - fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
body: <p>I have been trying to install Cython for Python 2.7 on my Window 7 system. In particular, I prefer everything in 64 bits. (In case you wonder, I need Cython because Cython is one of the components I need for another package for some specialized numerical analysis. And x64 is potentially an advantage for storage of large data sets.)</p>
  
  <p>So I downloaded the x64 Python 2.7 from the official website. Got Cython from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython" rel="noreferrer">Christoph Gohlke</a>. The amd64 version for Python 2.7 of course. Before I installed, I added Python 2.7 into the registry with the <code>.reg</code> file found in <a href="https://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows/9131949#9131949">Joe DF's answer here</a>. Afterwards, I installed the Visual C++ compiler from <a href="http://www.microsoft.com/en-ca/download/details.aspx?id=15336" rel="noreferrer">here</a> (I don't think it works) and <a href="http://www.microsoft.com/en-us/download/details.aspx?id=3138" rel="noreferrer">here</a> (but this one should). At this point, I have in my <code>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin</code> directory all of <code>vcvars32.bat</code>, <code>vcvars64.bat</code>, <code>vcvars86_amd64.bat</code>, <code>vcvarsx86_ia64.bat</code>. I ran <code>vcvars64.bat</code> and there was no error message.</p>
  
  <p>Subsequently, I followed <a href="http://docs.cython.org/src/quickstart/build.html" rel="noreferrer">this page</a> to create a "hello world" test file.</p>
  
  <p>Then, I got this error.</p>
  
  <pre><code>...\Tests&gt;python setup.py build_ext --inplace
  running build_ext
  building 'hello' extension
  error: Unable to find vcvarsall.bat
  </code></pre>
  
  <p>So I thought to myself: Well, Cython can't find that file because it does not exist. (I searched my whole harddrive for it.) So I copied <code>vcvars64.bat</code> from <code>...\VC\bin</code> to <code>\VC</code> and changed the name to <code>vcvarsall.bat</code>. Now vcvarsall error is gone. And ... naturally, a new error emerges.</p>
  
  <pre><code>...\Tests&gt;python setup.py build_ext --inplace
  running build_ext
  building 'hello' extension
  C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nolog
  o /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tchello.c /F
  obuild\temp.win-amd64-2.7\Release\hello.obj
  hello.c
  C:\Python27\include\pyconfig.h(227) : fatal error C1083: Cannot open include fil
  e: 'basetsd.h': No such file or directory
  error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64
  \cl.exe"' failed with exit status 2
  </code></pre>
  
  <p>Now I have no idea how to proceed. What should I do? Your help is much appreciated.</p>
  
  <p>(For clarity, I did try setting the compiler to Mingw32. But there are other errors. I am focusing on getting VC to work for now.)</p>
  
  <hr>
  
  <p>EDIT: I tried using the SDK build environment CMD following the instructions on <a href="http://docs.cython.org/src/quickstart/build.html" rel="noreferrer">this page</a>. I received the same error.</p>