importerror:libsasl2.so.3:无法打开共享对象文件:没有这样的文件或目录

izkcnapc  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(821)

我写了这个代码:

  1. from pyhive import hive
  2. connection = hive.connect("quickstart.cloudera", username="cloudera",
  3. port=10000)
  4. cursor = connection.cursor()
  5. query = "SELECT * FROM capacite_part"
  6. cursor.execute(query)
  7. for row in cursor.fetchall():
  8. print(row[0], row[1])

我明白了:

  1. In [6]: runfile('/home/cloudera/lire data capacite_part.py', wdir='/home/cloudera')
  2. Traceback (most recent call last):
  3. File "<ipython-input-6-c3cdfa2f79a9>", line 1, in <module>
  4. runfile('/home/cloudera/lire data capacite_part.py', wdir='/home/cloudera')
  5. File "/home/cloudera/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile
  6. execfile(filename, namespace)
  7. File "/home/cloudera/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
  8. builtins.execfile(filename, *where)
  9. File "/home/cloudera/lire data capacite_part.py", line 7, in <module>
  10. from pyhive import hive
  11. File "/home/cloudera/anaconda2/lib/python2.7/site-packages/pyhive/hive.py", line 22, in <module>
  12. import sasl
  13. File "/home/cloudera/anaconda2/lib/python2.7/site-packages/sasl/__init__.py", line 15, in <module>
  14. from sasl.saslwrapper import *
  15. ImportError: libsasl2.so.3: cannot open shared object file: No such file or directory

这是我的配置:

  1. CLOUDERA CD5 CENTOS 6.7
  2. Python 2.7.13 :: Anaconda 4.4.0 (64-bit)

这是pip Package :
[cloudera@quickstart ~]$pip冻结

  1. alabaster==0.7.10
  2. anaconda-client==1.6.3
  3. anaconda-navigator==1.6.2
  4. anaconda-project==0.6.0
  5. asn1crypto==0.22.0
  6. astroid==1.4.9
  7. astropy==1.3.2
  8. Babel==2.4.0
  9. backports-abc==0.5
  10. backports.shutil-get-terminal-size==1.0.0
  11. backports.ssl-match-hostname==3.4.0.2
  12. beautifulsoup4==4.6.0
  13. bitarray==0.8.1
  14. blaze==0.10.1
  15. bleach==1.5.0
  16. bokeh==0.12.5
  17. boto==2.46.1
  18. Bottleneck==1.2.1
  19. cdecimal==2.3
  20. cffi==1.10.0
  21. chardet==3.0.3
  22. click==6.7
  23. cloudpickle==0.2.2
  24. clyent==1.2.2
  25. colorama==0.3.9
  26. conda==4.3.21
  27. configparser==3.5.0
  28. contextlib2==0.5.5
  29. cryptography==1.8.1
  30. cycler==0.10.0
  31. Cython==0.25.2
  32. cytoolz==0.8.2
  33. dask==0.14.3
  34. datashape==0.5.4
  35. decorator==4.0.11
  36. distributed==1.16.3
  37. docutils==0.13.1
  38. entrypoints==0.2.2
  39. enum34==1.1.6
  40. et-xmlfile==1.0.1
  41. fastcache==1.0.2
  42. Flask==0.12.2
  43. Flask-Cors==3.0.2
  44. funcsigs==1.0.2
  45. functools32==3.2.3.post2
  46. future==0.16.0
  47. futures==3.1.1
  48. gevent==1.2.1
  49. greenlet==0.4.12
  50. grin==1.2.1
  51. h5py==2.7.0
  52. HeapDict==1.0.0
  53. html5lib==0.999
  54. idna==2.5
  55. imagesize==0.7.1
  56. ipaddress==1.0.18
  57. ipykernel==4.6.1
  58. ipython==5.3.0
  59. ipython-genutils==0.2.0
  60. ipywidgets==6.0.0
  61. isort==4.2.5
  62. itsdangerous==0.24
  63. jdcal==1.3
  64. jedi==0.10.2
  65. Jinja2==2.9.6
  66. jsonschema==2.6.0
  67. jupyter==1.0.0
  68. jupyter-client==5.0.1
  69. jupyter-console==5.1.0
  70. jupyter-core==4.3.0
  71. lazy-object-proxy==1.2.2
  72. llvmlite==0.18.0
  73. locket==0.2.0
  74. lxml==3.7.3
  75. MarkupSafe==0.23
  76. matplotlib==2.0.2
  77. mistune==0.7.4
  78. mpmath==0.19
  79. msgpack-python==0.4.8
  80. multipledispatch==0.4.9
  81. navigator-updater==0.1.0
  82. nbconvert==5.1.1
  83. nbformat==4.3.0
  84. networkx==1.11
  85. nltk==3.2.3
  86. nose==1.3.7
  87. notebook==5.0.0
  88. numba==0.33.0+0.ge79330a.dirty
  89. numexpr==2.6.2
  90. numpy==1.12.1
  91. numpydoc==0.6.0
  92. odo==0.5.0
  93. olefile==0.44
  94. openpyxl==2.4.7
  95. packaging==16.8
  96. pandas==0.20.1
  97. pandocfilters==1.4.1
  98. partd==0.3.8
  99. pathlib2==2.2.1
  100. patsy==0.4.1
  101. pep8==1.7.0
  102. pexpect==4.2.1
  103. pickleshare==0.7.4
  104. Pillow==4.1.1
  105. ply==3.10
  106. prompt-toolkit==1.0.14
  107. psutil==5.2.2
  108. ptyprocess==0.5.1
  109. py==1.4.33
  110. pycairo==1.10.0
  111. pycosat==0.6.2
  112. pycparser==2.17
  113. pycrypto==2.6.1
  114. pycurl==7.43.0
  115. pyflakes==1.5.0
  116. Pygments==2.2.0
  117. PyHive==0.3.0
  118. pylint==1.6.4
  119. pyodbc==4.0.16
  120. pyOpenSSL==17.0.0
  121. pyparsing==2.1.4
  122. pytest==3.0.7
  123. python-dateutil==2.6.0
  124. pytz==2017.2
  125. PyWavelets==0.5.2
  126. PyYAML==3.12
  127. pyzmq==16.0.2
  128. QtAwesome==0.4.4
  129. qtconsole==4.3.0
  130. QtPy==1.2.1
  131. requests==2.14.2
  132. rope==0.9.4
  133. sasl==0.2.1
  134. scandir==1.5
  135. scikit-image==0.13.0
  136. scikit-learn==0.18.1
  137. scipy==0.19.0
  138. seaborn==0.7.1
  139. simplegeneric==0.8.1
  140. singledispatch==3.4.0.3
  141. six==1.10.0
  142. snowballstemmer==1.2.1
  143. sortedcollections==0.5.3
  144. sortedcontainers==1.5.7
  145. Sphinx==1.5.6
  146. spyder==3.1.4
  147. SQLAlchemy==1.1.9
  148. statsmodels==0.8.0
  149. subprocess32==3.2.7
  150. sympy==1.0
  151. tables==3.3.0
  152. tblib==1.3.2
  153. terminado==0.6
  154. testpath==0.3
  155. thrift==0.10.0
  156. thrift-sasl==0.2.1
  157. toolz==0.8.2
  158. tornado==4.5.1
  159. traitlets==4.3.2
  160. unicodecsv==0.14.1
  161. wcwidth==0.1.7
  162. Werkzeug==0.12.2
  163. widgetsnbextension==2.0.0
  164. wrapt==1.10.10
  165. xlrd==1.0.0
  166. XlsxWriter==0.9.6
  167. xlwt==1.2.0
  168. zict==0.1.2

有人知道它为什么不起作用吗?
提前多谢。。。
(之前,我已经安装了一个最新的anaconda发行版,使用python3.6…它也在做同样的事情…)
在哪里可以买到centos 6.7和x64位的新libsasl2.so.3。。。?

dsf9zpds

dsf9zpds1#

有时,可以通过与同一库的另一个版本创建符号链接来解决这些版本问题。如果已安装libsasl2.so,请为其创建链接文件libsasl2.so.2:

  1. sudo ln -s /usr/lib64/libsasl2.so /usr/lib64/libsasl2.so.2

相关问题