title: How to install JPype on OS X Lion to use with Neo4j?
body: <p>I am trying to use Neo4j for a project, and want to interface with it through Python since I'm a newbie to programming and don't know any Java. I'm following the <a href="http://docs.neo4j.org/chunked/snapshot/python-embedded-installation.html" rel="nofollow noreferrer">installation instructions</a>, but I'm stuck on
  the first step, which is to install JPype.</p>
  
  <p>I'm using OS X 10.7 (lion). I think my configuration is pretty standard
  with Python 2.7.2 downloaded from the Python website and Java 1.6.0 downloaded from the Apple website.</p>
  
  <p>When I run</p>
  
  <pre><code>% sudo python setup.py install
  </code></pre>
  
  <p>On the JPype installer, I get about a 100 lines of error code about various .h files, then it
  terminates with the lines:</p>
  
  <pre><code>lipo: can't figure out the architecture type of: /var/tmp//
  ccwOzLi9.out
  
  error: command 'gcc-4.2' failed with exit status 1
  </code></pre>
  
  <p>I found a <a href="http://blog.y3xz.com/post/5037243230/installing-jpype-on-mac-os-x" rel="nofollow noreferrer">blog post about a gcc error with JPype</a>, but I followed the instructions there to no avail. I also emailed the author of that post, and he told me had never actually used JPype, had been working in OS X 10.6, and didn't have any insight.</p>
  
  <p>I also emailed the creator of JPype, who told me that he only uses Windows, and has no idea how to make the install work on OS X. But if we can solve this, I can point him to the answer and maybe he can add the solution to the JPype documentation and help lots of other people as well!</p>
  
  <p>So, anyone know what I'm doing wrong? I would like to use Neo4j, but I
  don't know Java so I'm at a complete loss for how to fix a compiler
  error.</p>
  
  <p>Based on reading every Google result available, my two running
  theories are that:</p>
  
  <ol>
  <li><p>I'm somehow using a 32-bit version of Python or of Java (though I
  used standard official installations and can't figure out how to
  switch to 64-bit or if that's even possible)</p></li>
  <li><p>The JPype files can only be compiled using GCC 4.0 instead of 4.2.
  But I can't find anything online about how to rollback to GCC 4.0 (or
  if it comes shipped with 2011 MacBooks and there is some way to force
  JPype to compile with that instead). </p></li>
  </ol>
  
  <p>There is <a href="https://stackoverflow.com/questions/7103024/neo4j-jpype-installation-issue">another similar question</a>, but the solution there is to use a different adapter that goes through REST instead of hooking directly into Java. I will try that if I have to, but I would really rather use the recommended Neo4j method if it's possible.</p>