在远程IPython集群上运行作业时出现“execution_count”错误

时间:2013-05-21 05:19:22

标签: python ssh ipython ipython-parallel

我在远程Linux机器上运行IPython集群(SSH),我使用Mac OS X和IPython来使用该集群。在Mac上的IPython中我写道:

from IPython.parallel import Client
c = Client('~/ipcontroller-client.json', sshserver="me@remote_linux_machine")
dview=c[:]
dview.scatter('m', arange(100))

其中'~/ipcontroller-client.json'是从remote_linux_machine复制的文件。一切都达到了这一点。

当我尝试使用并行魔法%px时,我收到错误:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/parallel/client/client.pyc
in __init__(self, msg_id, content, metadata)
     80         self.msg_id = msg_id
     81         self._content = content
---> 82         self.execution_count = content['execution_count']
     83         self.metadata = metadata
     84 

KeyError: 'execution_count'

同样的想法,但是当我在 localhost 上运行集群时,它运行良好。

对于远程SSH群集情况,并行魔法是否应该起作用?

1 个答案:

答案 0 :(得分:2)

问题现已解决:需要确保集群和您正在使用它的机器上的IPython版本相同(我的是0.13.2)。

在Linux机器上,我必须指定我需要安装的版本,因为标准IPython是在0.12.1版本下安装的:

sudo apt-get install ipython=0.13.2-1~ubuntu12.04.1