【发布时间】:2014-11-12 18:33:28
【问题描述】:
我正在玩子进程库。我可以表演
v = subprocess.check_output("ls")
而且效果很好。但是,当我通过 SSH 连接到一台机器并且我想执行一个 hadoop 命令时,
v = subprocess.check_output("hadoop fs -ls /path/to/file* | grep -oE '/(.*)'")
我明白了
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'check_output'
不太清楚为什么。我认为这可能是我对子流程缺乏了解。我该如何解决这个错误?
【问题讨论】:
-
远程机器上的python是什么版本?
-
@PadraicCunningham 2.6.7