title: hbase module not found in python - how to import?
body: <p>I have installed hadoop with <a href="http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/" rel="nofollow noreferrer">this tutorial</a>, <a href="http://ria101.wordpress.com/2010/01/28/setup-hbase-in-pseudo-distributed-mode-and-connect-java-client/" rel="nofollow noreferrer">hbase with this one</a>, and <a href="http://whynosql.com/using-thrift-python-client-with-hbase/" rel="nofollow noreferrer"><code>hbase.thrift</code> with this one</a></p>
  
  <p>Now I have a given python script, which is there to created some hbase tables. When I run the py file it gives me the error: </p>
  
  <pre><code>Traceback (most recent call last):
    File "./createTables.py", line 9, in &lt;module&gt;
      from hbase import Hbase
  ImportError: No module named hbase
  </code></pre>
  
  <p>This question seemed to have the same trouble: <a href="https://stackoverflow.com/questions/9281742/how-can-i-import-hbase-in-python">How can I import hbase in python?</a></p>
  
  <p>I tried the solution given there. I ran </p>
  
  <pre><code>thrift --gen py Hbase.thrift
  </code></pre>
  
  <p>in the <code>/usr/lib/hbase-0.94.2/src/main/resources/org/apache/hadoop/hbase/thrift</code> folder, where the <code>Hbase.thrift</code> was located. Ot created the subfolder <code>gen-py</code>, as descibed in the tutorial linked in above similiar question.</p>
  
  <p>Now, if I get the "Simply take that command and copy it to your default module folder (or in the folder where you run your program and it should work)." Part of given solution there right, I go to the folder in which my given py file is located (say <code>/home/kumo/Downloads/createTables.py</code>) and run </p>
  
  <pre><code>thrift --gen py /usr/lib/hbase-0.94.2/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
  </code></pre>
  
  <p>...? But nothing happes with that. Copying the Hbase.thrift file into the Downloads folder next to the py file, gives only </p>
  
  <pre><code>[FAILURE:arguments:1] Could not open input file with realpath: ./Hbase.thrift
  </code></pre>
  
  <p>So obviously not helping either.</p>
  
  <p>I also tried adding </p>
  
  <pre><code>import sys
  sys.path.append('/usr/lib/hbase-0.94.2/src/main/resources/org/apache/hadoop/hbase/thrift/gen-py')
  </code></pre>
  
  <p>gave the same intial missing modules error again. </p>
  
  <p>I also tried adding the 5.c. step of the thrift tutorial by adding the python path in the .bashrc:</p>
  
  <pre><code>export PYTHONPATH=$PYTHONPATH:/usr/lib/hbase-0.94.2/src/main/resources/org/apache/hadoop/hbase/thrift/gen-py
  </code></pre>
  
  <p>did not really work.</p>
  
  <p>I tired the same with the path <code>/usr/local/hadoop/src/contrib/thriftfs/gen-py</code>, as that is another gen-py folder that somehow popped up, both as a sys import and pythonpath export, but it still gives me the same error.</p>
  
  <p>I am still new to all of this, so I just followed the tutorials step by step. I have no clue what I may have missed or wasn't in the tutorials to begin with.</p>
  
  <p>Thanks for any help!</p>