【发布时间】:2015-11-11 12:33:36
【问题描述】:
我正在尝试从我的 java 应用程序连接到 rethink db(具有 python 驱动程序)。 RethinkDB python 安装部分https://www.rethinkdb.com/docs/install-drivers/python/ 没有明确下载 python 模块的地方。因为对我来说,我正在尝试使用 jython 进行连接,但它失败了
代码:
String s = "import rethinkdb as r\n" +
"r.connect('localhost', 28015).repl()\n" +
"r.table('tv_shows').insert({ 'name': 'Star Trek TNG' }).run()";
PyCode code = python.compile(s);
python.exec(code);
System.out.println("Done..");
错误:
线程“main” Traceback 中的异常(最后一次调用): 文件“”,第 1 行,在 ImportError: 没有名为 rethinkdb 的模块
关于我在哪里可以显式获取 rethinkdb 模块以及如何使其可用于我的 Java 应用程序的任何想法? (假设把它放到类路径中)
【问题讨论】:
标签: python jython rethinkdb rethinkdb-python