title: Python: Cython build issues
body: <p>I have been having many issues building Cython in my virtual machine in windows, I had no problems in OSX and its really starting to frustrate me...</p>
  
  <p>Long story short I am trying to build/install the following libraries:
  - Cython-0.19.2
  - cython-hidapi
  - pycrypto-2.6.1</p>
  
  <p>Lets start with Cython... </p>
  
  <p><code>&gt;&gt;setup.py clean install</code></p>
  
  <pre><code>running clean
  running install
  running build
  running build_py
  running build_ext
  building 'Cython.Compiler.Code' extension
  error: Unable to find vcvarsall.bat`
  </code></pre>
  
  <p>This can be rectified by: <code>SET VS90COMNTOOLS=%VS120COMNTOOLS%</code> <strong>but is not permanent, how can I make this permanent?</strong></p>
  
  <p>Then run <code>&gt;&gt;setup.py clean install</code> again:</p>
  
  <pre><code>running clean
  running install
  running build
  running build_py
  running build_ext
  building 'Cython.Compiler.Code' extension
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  creating build\temp.win-amd64-2.7\Release\Cython
  creating build\temp.win-amd64-2.7\Release\Cython\Compiler
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /TcCython\Compiler\Code.c /Fobuild\temp.win-amd64-2.7\Release\Cython\Compiler\Code.obj
  Code.c
  c:\python27\include\pymath.h(22) : warning C4273: 'round' : inconsistent dll linkage
          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(51
  6) : see previous definition of 'round'
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /EXPORT:initCode build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.obj /OUT:build\lib.win-amd64-2.7\Cython\Compiler\Code.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.pyd.manifest
  Code.obj : warning LNK4197: export 'initCode' specified multiple times; using first specification
     Creating library build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.lib an
  d object build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.exp
  C:\Program Files (x86)\Windows Kits\8.1\bin\x64\mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.pyd.manifest -outputresource:build\lib.win-amd64-2.7\Cython\Compiler\Code.pyd;2
  build\temp.win-amd64-2.7\Release\Cython\Compiler\Code.pyd.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified.
  error: command 'mt.exe' failed with exit status 31
  </code></pre>
  
  <p>Nothing I do seems to rectify this second issue, I have VS2013 installed. Im sure this all can be fixed in my environment variable %PATH%... but im not sure what is wrong with them:</p>
  
  <blockquote>
    <p>c:\altera\12.1sp1\modelsim_ase\win32aloem;C:\Python27;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;SET VS90COMNTOOLS=%VS120COMNTOOLS%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include</p>
  </blockquote>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Still looking for permanent fix for first issue.</p>
  
  <p><strong>Fix For 2nd problem:</strong>
  Microsoft Security Essentials is locking the manifest file, adding your project directories to its excluded directories fix the issue.</p>
  
  <p><strong>New issue:</strong>
  When building Cython-HIDAPI:</p>
  
  <pre><code>running clean
  removing 'build\temp.win-amd64-2.7' (and everything under it)
  removing 'build'
  running install
  running build
  running build_ext
  skipping 'hid.c' Cython extension (up-to-date)
  building 'hid' extension
  creating build
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tchid.c /Fobuild\temp.win-amd64-2.7\Release\hid.obj
  hid.c
  c:\python27\include\pymath.h(22) : warning C4273: 'round' : inconsistent dll linkage
          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(516) : see previous definition of 'round'
  hid.c(801) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of dataC:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27\include -IC:\Python27\PC /Tchid-libus
  b.c /Fobuild\temp.win-amd64-2.7\Release\hid-libusb.obj
  hid-libusb.c
  hid-libusb.c(34) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
  error: command '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe"' failed with exit status 2
  </code></pre>
  
  <p><strong>Fixed by Modifying the C file to check for win vs linux headers...</strong></p>
  
  <pre><code>#ifdef __linux__ 
      /* Unix */
      #include &lt;unistd.h&gt;
      #include &lt;sys/types.h&gt;
      #include &lt;sys/stat.h&gt;
      #include &lt;sys/ioctl.h&gt;
      #include &lt;sys/utsname.h&gt;
      #include &lt;fcntl.h&gt;
      #include &lt;pthread.h&gt;
  #endif
  </code></pre>
  
  <p><strong>Most of the remaining issues where fixed in this manner</strong></p>
  
  <p><strong>Will post a new question for the last problem I am having since this one is getting cluttered, Ill leave this up for anyone else that may have this problem in the future</strong></p>