Why "TypeError: 'module' object is not callable" occurs on calling impala.dbapi.connect()?
<p>I am trying to connect to impala and I am following <a href="https://github.com/cloudera/impyla" rel="nofollow">impyla guide</a>. But I am getting this error as I execute connect(). The error is shown below:</p>

<pre><code>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 "&lt;ipython-input-28-c9f42dc37774&gt;", line 4, in &lt;module&gt;
    password="password")

TypeError: 'module' object is not callable
</code></pre>

<p>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.</p>

<p><strong>UPDATE:</strong></p>

<p>The above error has been resolved after this below change:</p>

<pre><code>from impala.dbapi import connect
</code></pre>

<p>But now I am facing another error after executing this line of code:</p>

<pre><code>cursor = conn.cursor()
</code></pre>

<p>and the error is as below:</p>

<pre><code>.
.
.

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

MemoryError
</code></pre>

<p>Waiting for suggestions to resolve this issue. Thanks for your time :)</p>

<p>I think what you wanted to do is:
<code>from impala.dbapi import connect</code></p>

<p>In your code you are using impala.dbapi (module) renamed as <code>connect</code>...</p>

python hadoop thrift impala