title: Scipy - Sparse Library ImportError: DLL load failed: %1 is not a valid Win32 application
body: <p>I have recently been moving my programming to a 64-bit windows 7 machine and have been install the relevant libraries. However I am having issues with the Scipy - Sparse library. </p>
  
  <p>I have installed scipy0.12.0-amd64-py27 (as my python 2.7 install is the 64-bit release) release for windows and when using the scipy library directly I encounter no errors. e.g. </p>
  
  <pre><code>import scipy
  print scipy.version
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>&lt;module 'scipy.version' from 'C:\Python27\lib\site-packages\scipy\version.pyc'&gt;
  </code></pre>
  
  <p>As expected.</p>
  
  <p>However when trying the import the sparse library as follows:</p>
  
  <pre><code>from scipy import sparse
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>ImportError: DLL load failed: %1 is not a valid Win32 application.
  </code></pre>
  
  <p>Sadly my knowledge is limited and I cannot seem to find a relevant solution. The closest was that I had installed the wrong library, however I cannot see why this would be the case if the root scipy library was working correctly.</p>
  
  <p>Does anyone know of a solution to this? Or would it be better to use one of the python packages for windows with scipy installed directly?</p>
  
  <p>Thanks</p>
  
  <p>edit:</p>
  
  <p>Here is the traceback from the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Piers\Documents\Physics\PhD\Code\Far Time Crank-Nicholson\FarTimeCrankNicholson.py", line 16, in &lt;module&gt;
      from scipy import sparse
    File "C:\Python27\lib\site-packages\scipy\sparse\__init__.py", line 182, in &lt;module&gt;
      from .csr import *
    File "C:\Python27\lib\site-packages\scipy\sparse\csr.py", line 15, in &lt;module&gt;
      from .sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
    File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\__init__.py", line 5, in &lt;module&gt;
      from .csr import *
    File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\csr.py", line 26, in &lt;module&gt;
      _csr = swig_import_helper()
    File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\csr.py", line 22, in swig_import_helper
      _mod = imp.load_module('_csr', fp, pathname, description)
  ImportError: DLL load failed: %1 is not a valid Win32 application.
  </code></pre>