0

我正在尝试使用 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

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

4

2 回答 2

0

JayDebeApi 包含用于从 Python 运行 Java 类的 JPype。在安装 JayDebeApi 之前是否需要安装 C++ Compiler for Python

视窗

于 2018-04-06T19:55:31.157 回答
0

或者,您可以直接获取 Jpype 轮(如果出于身份验证原因您无法安装 C++ 开发套装)

jpype 轮子文件

于 2018-08-24T16:19:53.707 回答