title: How to import bitarray using pypy?
body: <p>I am running <a href="http://doc.pypy.org/en/latest/getting-started-python.html" rel="nofollow">pypy</a> and after adding the path to the bitarray library to <code>sys.path</code> I still can't import the module: </p>
  
  <pre><code>Python 2.7.3 (87aa9de10f9ca71da9ab4a3d53e0ba176b67d086, Feb 10 2014, 05:26:49)
  [PyPy 2.2.1 with GCC 4.7.2] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  And now for something completely different: ``every VM should come with neural
  network trained to recognize microbenchmarks and randomly fluctuate them
  +/-9000%''
  &gt;&gt;&gt;&gt; import sys
  &gt;&gt;&gt;&gt; sys.path.append('/usr/local/lib/python2.7/dist-packages/')
  &gt;&gt;&gt;&gt; sys.path.append('/usr/local/lib/python2.7/dist-packages/bitarray/')
  &gt;&gt;&gt;&gt; import bitarray
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/dist-packages/bitarray/__init__.py", line 11, in &lt;module&gt;
      from bitarray._bitarray import _bitarray, bitdiff, bits2bytes, _sysinfo
  ImportError: No module named bitarray._bitarray
  </code></pre>
  
  <p>In regular python (CPython installed from aptitude) importing bitarray works fine and I haven't made any modifications to the module after installing it with pip. What's wrong here?</p>
  
  <p>Just in case you need it here is the content of the bitarray dir: </p>
  
  <pre><code>$ls  /usr/local/lib/python2.7/dist-packages/bitarray/
  _bitarray.so  __init__.py  __init__.pyc  test_bitarray.py  test_bitarray.pyc
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After creating a virtualenv for pypy and installing bitarray with pip as Sunny suggested I still get an ImportError:</p>
  
  <pre><code>$ ls my-pypy-env/site-packages/bitarray
  _bitarray.pypy-22.so  __init__.py  __init__.pyc  test_bitarray.py  test_bitarray.pyc
  
  
  $ cd my-pypy-env/
  ~/my-pypy-env$ ./bin/activate 
  ~/my-pypy-env$ pypy
  Python 2.7.3 (87aa9de10f9ca71da9ab4a3d53e0ba176b67d086, Feb 10 2014, 05:26:49)
  [PyPy 2.2.1 with GCC 4.7.2] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  And now for something completely different: ``__xxx__ and __rxxx__ vs operation
  slots: particle quantum superposition kind of fun''
  &gt;&gt;&gt;&gt; import sys
  &gt;&gt;&gt;&gt; sys.path.append('/home/sofia/my-pypy-env/site-packages/bitarray')
  &gt;&gt;&gt;&gt; import bitarray
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named bitarray
  </code></pre>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Sunny's solution is correct. The new problem was appending <code>/site-packages/bitarray</code> 
  instead of just <code>/site-packages/</code>. I would have though that virtualenv would add this to the path automatically but it seems that it doesn't. </p>