title: How to install numpy for PyPy on Windows?
body: <p>I've just installed <a href="http://www.pypy.org/" rel="nofollow noreferrer">PyPy</a> on Windows and seen an approximately 10x speed improvement in some simulation code I'm running. I'd like to see similar on code using numpy, too. I'm not an experienced Python programmer however and I'm finding the <a href="http://www.pypy.org/download.html#installing-numpy" rel="nofollow noreferrer">instructions</a> hard to follow. Does anyone know if installing numpy for PyPy on Windows is possible and if so what's the easiest way to do it?</p>
  
  <p>The instructions provide two options.</p>
  
  <p><strong>Option no 1</strong></p>
  
  <blockquote>
    <p>If you have pip (the command-line assumes that it finds the pip belonging to PyPy, not the one from CPython):</p>
  </blockquote>
  
  <pre><code>pip install git+https://bitbucket.org/pypy/numpy.git
  </code></pre>
  
  <p>this seems like a great option but I can't find <code>pip</code> in the directory structure I unzipped into.</p>
  
  <p><strong>Option no 2</strong></p>
  
  <blockquote>
    <p>Alternatively, the direct way:</p>
  </blockquote>
  
  <pre><code>git clone https://bitbucket.org/pypy/numpy.git
  cd numpy
  pypy setup.py install
  </code></pre>
  
  <p>I haven't got <code>git</code> on Windows, but also I'm suspicious this option might involve compiling source code from <code>https://bitbucket.org/pypy/numpy.git</code>, and might not even be possible (or require a lot of hacking) on Windows.</p>
  
  <p><em>Edit</em></p>
  
  <p>Installing pip via <a href="https://sites.google.com/site/pydatalog/python/pip-for-windows" rel="nofollow noreferrer">https://sites.google.com/site/pydatalog/python/pip-for-windows</a> as per <a href="https://stackoverflow.com/a/22817597/834521">the answer below</a>, or the instructions in <a href="https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/9038397#9038397">this answer</a> to the question <a href="https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/9038397#9038397">How do I install pip on Windows?</a>, failed with <code>ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /packages/py2.py3/p/pip/pip-1.5.4-py2.py3-none-any.whl (Caused by &lt;class 'httplib.BadStatusLine'&gt;: '')</code>. See, e.g., <a href="https://github.com/pypa/pip/issues/1608" rel="nofollow noreferrer">this bug report</a>. However I <em>was</em> able to install pip via Microsoft Visual Studio <a href="http://pytools.codeplex.com/" rel="nofollow noreferrer">PTVS</a> by right-clicking PyPy 2.7 under Python environments in Solution Explorer, selecting Install Python Package. This failed to install numpy (with another connection error) but <em>did</em> install pip.</p>
  
  <p>Now that I have pip, I tried to install numpy on the command line using <code>pip install git+https://bitbucket.org/pypy/numpy.git</code>. First of all I needed to install git to do this... no problem. But then it failed with the following</p>
  
  <pre><code>building library "npymath" sources
  No module named numpy.distutils.msvccompiler in numpy.distutils; trying from distutils
  error: Unable to find vcvarsall.bat
  </code></pre>
  
  <p>I'm unfamiliar with installation of Python packages and I'm not sure what this means. I do have Visual Studio 2012 with the C++ compiler installed, but on the other hand <a href="http://mail.scipy.org/pipermail/numpy-discussion/2012-November/064454.html" rel="nofollow noreferrer">this thread</a> for Python 3.3 (I'm using 2.7 at the moment) seems to imply that a C++ compiler shouldn't be needed.</p>
  
  <p><em>Edit</em></p>
  
  <p>This seems to be nothing to do with pip installation. Following option 2</p>
  
  <pre><code>git clone https://bitbucket.org/pypy/numpy.git
  cd numpy
  pypy setup.py install
  </code></pre>
  
  <p>I still get <code>Unable to find vcvarsall.bat</code>. However, taking a hint from <a href="https://stackoverflow.com/a/8705722/834521">this answer</a>, <code>vcvarsall.bat</code> can be found if you set the environment variable <code>VS90COMNTOOLS</code> to the appropriate directory. In my case I have VS2012, so the appropriate line is</p>
  
  <pre><code>set VS90COMNTOOLS=%VS110COMNTOOLS%
  </code></pre>
  
  <p>Now the compiler can be found but there is a compile error</p>
  
  <pre><code>_configtest.c
  _configtest.c(4) : error C2061: syntax error : identifier 'npy_check_sizeof_type'
  _configtest.c(4) : error C2059: syntax error : ';'
  _configtest.c(7) : error C2065: 'npy_check_sizeof_type' : undeclared identifier error:
  </code></pre>
  
  <p>It seems like this is a file generated during the compile process that probably doesn't even need to be built. Nevertheless I think I might be really stuck now...</p>