impyla (0.14.0) ERROR - 'TSocket' object has no attribute 'isOpen'

4.9k Views Asked by At

I am getting the following error while trying to create a connection to HiveServer

 Traceback (most recent call last):
  File "/Users/user_name/Desktop/ABCo/EEM/EntityManagement/lodurr/data_lake/hive_db.py", line 56, in wrapper
    auth_mechanism='PLAIN')
  File "/Users/user_name/.virtualenvs/entity1/lib/python3.6/site-packages/impala/dbapi.py", line 147, in connect
    auth_mechanism=auth_mechanism)
  File "/Users/user_name/.virtualenvs/entity1/lib/python3.6/site-packages/impala/hiveserver2.py", line 758, in connect
    transport.open()
  File "/Users/user_name/.virtualenvs/entity1/lib/python3.6/site-packages/thrift_sasl/__init__.py", line 67, in open
    if not self._trans.isOpen():

These are the packages that I have installed when I do pip list

  • six (1.11.0)
  • thriftpy (0.3.9)
  • thrift-sasl (0.3.0)
  • sasl (0.2.1)
  • impyla (0.14.0)

I am using a macOS High Sierra as my development environment

3

There are 3 best solutions below

2
Umberto Boscolo On

Not sure what the issue is but can you try with

thrift-sasl==0.2.1

1
Rene B. On

I had the same issue and useed the following packages:

pip uninstall thrift-sasl
pip uninstall impyla
pip uninstall thrift

pip install thrift-sasl==0.2.1 
pip install thrift==0.9.3
pip install impyla==0.13.8
0
ebeb On

This also got resolved by installing the latest versions of of Impyla (0.16.2) and thrift-sasl (0.4.2) using:

pip install --upgrade impyla
pip install --upgrade thrift-sasl