Python - 使用JayDeBeApi连接到Hive时出错

时间:2017-10-01 23:17:09

标签: python jaydebeapi

我正在尝试使用Python脚本中的JayDeBeApi连接Hortonworks中的Hive。我已经安装了Python 64位并使用PyCharm IDE进行设置。我也安装了JayDeBeApi。我收到以下错误,不知道我错过了什么。

    C:\Python27\python.exe C:/Projects_Work/primex/tableau/TDEConnect.py
    Opening connection.....
    Traceback (most recent call last):
    File "C:/Projects_Work/primex/tableau/TDEConnect.py", line 47, in <module>
main()
    File "C:/Projects_Work/primex/tableau/TDEConnect.py", line 19, in main
with connect() as conn:
    File "C:/Projects_Work/primex/tableau/TDEConnect.py", line 30, in __enter__
{'user': sslUser, 'password': sslPassword}, driverPath, )
    File "C:\Python27\lib\site-packages\jaydebeapi\__init__.py", line 381, in connect
    jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
    File "C:\Python27\lib\site-packages\jaydebeapi\__init__.py", line 159, in _jdbc_connect_jpype
    import jpype
    File "C:\Python27\lib\site-packages\jpype\__init__.py", line 17, in <module>
from ._jpackage import *
    File "C:\Python27\lib\site-packages\jpype\_jpackage.py", line 18, in <module>
    import _jpype

    ImportError: DLL load failed: %1 is not a valid Win32 application.

    Process finished with exit code 1

任何输入都会很棒。感谢。

2 个答案:

答案 0 :(得分:0)

JayDebeApi包含用于从Python运行Java类的JPype。 在安装JayDebeApi

之前,是否已经安装了C ++ Compiler for Python

答案 1 :(得分:0)

或者,您可以直接获取Jpype滚轮(如果由于auth原因而无法安装C ++开发套件)

jpype wheel files