1

I'm trying to connect python to hive on windows 7 (64 bit) with python version 3.6

I have created environment in anaconda and installed these packages:

  • pure-sasl (0.4.0)
  • PyHive (0.5.1)
  • thrift (0.11.0)
  • thrift-sasl (0.3.0)

Code Connection :

from pyhive import hive
conn = hive.Connection(host="jdbc:hive2://localhost", port="10000", username="")

but I have this error which I can't solve for 2 days: ModuleNotFoundError: No module named 'ttypes' Error

I successfully connect java with hive but I need to connect By Python

Thanks in advance

Ryan Schaefer
  • 3,047
  • 1
  • 26
  • 46
Ahmed Hassan
  • 65
  • 1
  • 2
  • 12

1 Answers1

2

The "thrift" library is not compatible with python 3. Try it with python 2.7

Alpha001
  • 331
  • 1
  • 7
  • 18