Coder Social home page Coder Social logo

Comments (3)

wbolster avatar wbolster commented on August 13, 2024

I think you are importing your own test code instead of the HappyBase library, because your test file name is happybase.py. Local files come first in the import path. Try renaming your test file.

— Wouter

(Sent from my phone. Please ignore the typos.)

charlielin [email protected] schreef:

I don't know if it is a right place to ask questions, but don't know
where to go. Anyway...
I downloaded the happybase package from PayPI and installed it using
''python setup.py install --prefix=~/.local".
Then tried Python -c "import happybase", It's ok.
But when I run a script it shows the error below:

Traceback (most recent call last):
File "happybase.py", line 1, in
import happybase
File "/home/linqili/sh/thrift_hbase/happybase.py", line 3, in
connection = happybase.Connection('192.168.19.107', 39090)
AttributeError: 'module' object has no attribute 'Connection'

here is my test code:
import happybase

connection = happybase.Connection('192.168.19.107', 39090)

table = connection.table("AD_DSP")

for key, data in table.rows(['1003_64133', '1_1']):

print key, data

Did I do something wrong?


Reply to this email directly or view it on GitHub:
#53

from happybase.

charlielin avatar charlielin commented on August 13, 2024

I am so embarrassed about making this stupid mistake. Thanks for your reply with patience.
One more quetion, I think maybe it is about thrift.
When I call the connection.tables(), It returned a Exception below:
Traceback (most recent call last):
File "h.py", line 8, in
print connection.tables()
File "/.local/lib/python2.7/site-packages/happybase-0.7-py2.7.egg/happybase/connection.py", line 213, in tables
names = self.client.getTableNames()
File "
/.local/lib/python2.7/site-packages/happybase-0.7-py2.7.egg/happybase/hbase/Hbase.py", line 788, in getTableNames
return self.recv_getTableNames()
File "~/.local/lib/python2.7/site-packages/happybase-0.7-py2.7.egg/happybase/hbase/Hbase.py", line 803, in recv_getTableNames
raise x
thrift.Thrift.TApplicationException: Internal error processing getTableNames

Thrift version is 0.9.0 and the hbase version is HBase 0.94.2-cdh4.2.1.
Have you ever met this issue before?
Thanks again.

from happybase.

wbolster avatar wbolster commented on August 13, 2024

No worries. Your mistake was not stupid at all. The reason I immediately spotted it is because I made the same mistake many times before. :-)

About the issue you mentioned: never seen it before actually. Did you specify the right compat flag?

from happybase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.