Why "TypeError: 'module' object is not callable" occurs on calling impala.dbapi.connect()?

I am trying to connect to impala and I am following impyla guide. But I am getting this error as I execute connect(). The error is shown below:

In [27]: import impala.dbapi as connect

In [28]: conn = connect(host="some798.xyz.something", 
    ...:        port=22, 
    ...:        user="username", 
    ...:        password="password")
Traceback (most recent call last):

  File "<ipython-input-28-c9f42dc37774>", line 4, in <module>

TypeError: 'module' object is not callable

What is the possible reason that I am not being able to connect? I can connect to the server using the above mentioned parameters and can also access the database of my interest (using Putty shell). I have been searching allot but couldn't resolve it so far. Thanks allot for your time in advance and looking forward to your suggestions.


The above error has been resolved after this below change:

from impala.dbapi import connect

But now I am facing another error after executing this line of code:

cursor = conn.cursor()

and the error is as below:


File "C:\Temp\Anaconda\lib\site-packages\thrift\transport\TSocket.py", line 105, in read
buff = self.handle.recv(sz)


Waiting for suggestions to resolve this issue. Thanks for your time :)


I think what you wanted to do is: from impala.dbapi import connect

In your code you are using impala.dbapi (module) renamed as connect...

Need Your Help

Multi-Threading PHP vs Multi-Threading Python

php python multithreading pthreads

I know that PHP supports now Threads and i read here Python multi-threading is not better than muli-threading in java since Python has some issues with GIL.

Full Text Search with NodeJS

mysql node.js lucene full-text-search sphinx

I want to implete the full text search(FTS) queries in my node js application. The database I am using is MySQL. I know that MySQL does have inbuild support for FTS but sadly it does not support Si...