【问题标题】:"execution_count" error when running a job on a remote IPython cluster在远程 IPython 集群上运行作业时出现“execution_count”错误
【发布时间】:2013-05-21 05:19:21
【问题描述】:

我正在远程 Linux 机器上运行 IPython 集群 (SSH),并且我正在使用带有 IPython 的 Mac OS X 来使用该集群。在 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 集群情况,并行魔法是否应该起作用?

【问题讨论】:

    标签: python ssh ipython ipython-parallel


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2017-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多