Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 368
ameyrupji Avatar asked Oct 04 '17 19:10

ameyrupji


3 Answers

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
like image 143
Rene B. Avatar answered Oct 17 '22 22:10

Rene B.


Not sure what the issue is but can you try with

thrift-sasl==0.2.1

like image 39
Umberto Boscolo Avatar answered Oct 17 '22 23:10

Umberto Boscolo


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
like image 1
ebeb Avatar answered Oct 17 '22 22:10

ebeb