"没有有效的解析器"从python调用SBT时

时间:2016-12-01 05:38:54

标签: python scala sbt

我在python脚本中调用SBT,需要访问运行时依赖项。

如果我在逐步调试过程中调用下面的代码,那么我会得到所需的结果:

command = ["sbt", '"export runtime:dependencyClasspath"']
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

如果我在没有停在断点的情况下运行相同的代码,那么我得到以下内容:

[info] Loading project definition from /AAA/src/project
[info] Set current project to src (in build file:/AAA/src/)
[error] No valid parser available.
[error] "export runtime:dependencyClasspath"
[error]  ^

如何在python中获取项目的运行时依赖性?

1 个答案:

答案 0 :(得分:0)

您需要将参数中的额外引用移除到sbt

# Don't nest quotes in the second argument.
command = ["sbt", "export runtime:dependencyClasspath"]