3

I can't seem to get PyHive to work correctly. Yum reports Package cyrus-sasl-lib-2.1.26-20.el7_2.x86_64 already installed and latest version.

Hope I am just missing something. Please help?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-ce1195d3db11> in <module>()
----> 1 from pyhive import hive
      2 from TCLIService.ttypes import TOperationState
      3 cursor = hive.connect('localhost').cursor()
      4 cursor.execute('SELECT * FROM my_awesome_data LIMIT 10', async=True)
      5 

/opt/anaconda2/lib/python2.7/site-packages/pyhive/hive.py in <module>()
     18 import getpass
     19 import logging
---> 20 import sasl
     21 import sys
     22 import thrift.protocol.TBinaryProtocol

/opt/anaconda2/lib/python2.7/site-packages/sasl-0.2.1-py2.7-linux-x86_64.egg/sasl/__init__.py in <module>()

/opt/anaconda2/lib/python2.7/site-packages/sasl-0.2.1-py2.7-linux-x86_64.egg/sasl/saslwrapper.py in <module>()

/opt/anaconda2/lib/python2.7/site-packages/sasl-0.2.1-py2.7-linux-x86_64.egg/sasl/saslwrapper.py in __bootstrap__()

ImportError: libsasl2.so.2: cannot open shared object file: No such file or directory

1 Answers1

0

I seem to have found further information in another libsasl-related question, and the solution in Cloudera's Python-SASL GitHub.

The problem is that the sasl Python package is linked to an older version of the native library: libsasl2.so.2, which existed on RHEL/CentOS 6. On RHEL/CentOS 7, there's libsasl2.so.3, installed by cyrus-sasl-lib into /usr/lib64/.

The solution is to reinstall the sasl Python package:

pip uninstall sasl
pip install sasl
Eli Acherkan
  • 6,401
  • 2
  • 27
  • 34