神奇的功能``bash的未找到 [英] Magic function `bash ` not found
问题描述
我有一堆,我想在高性能集群,关于这一点我要预约得到的计算时间上运行模拟。由于保留由时间限制的,我正在开发一个自动化脚本,我可以 SCP
添加到集群中运行。然后,该脚本将下载相关仿真文件,运行它们,并上传结果。
I have a bunch of simulations that I want to run on a high-performance cluster, on which I should make reservations to get computing time. Since the reservations are bounded by time, I am developing an automation script that I can scp
into the cluster and run. This script will then download the relevant simulation files, run them, and upload the results.
本自动化脚本的一部分是在庆典
( CP
, SCP
等),剩下的就是在蟒蛇。为了开发这种自动化,我使用的是笔记本电脑IPython的
Part of this automation script is in bash
(cp
, scp
, etc) and the rest is in python. In order to develop this automation, I am using an IPython notebook.
到目前为止,我已经$ C $光盘片中所有的蟒自动化的东西在我的笔记本IPython的和我想现在写它的bash的一部分。
So far, I've coded all the python automation stuff in my IPython notebook and am trying to write the bash part of it now.
不过,似乎魔术 %%的bash
并不在我的笔记本IPython的工作。我收到以下错误,当我在这个单元格code:
However, it seems that the magic %%bash
doesn't work in my IPython notebook. I get the following error when I have this code in my cell:
细胞
%%bash
echo hi
错误
File "<ipython-input-22-62ec98e35224>", line 3
echo hi
^
SyntaxError: invalid syntax
在一时兴起,我想这样的:
On a whim, I tried this:
细胞
%%bash
print "hi"
错误
hi
ERROR: Magic function `bash` not found.
所以,我想这与 %%系统
, %%!
和 %%外壳
。但这些都不工作;他们都给予我同样的错误。
So I tried this with %%system
, %%!
and %%shell
. But none of those work; they all give me the same error.
这是怎么回事?我该如何解决这个问题?
Why is this happening? How can I fix this?
元数据:
- IPython的0.13.dev
- 的Python 2.7.1
- 的Mac OS X Lion的
推荐答案
这是由一个版本的错误引起的。我升级我的IPython的版本(0.13.1,现),这工作得很好。
This was caused by a version error. I upgraded my IPython version (0.13.1, now) and this works just fine.
所以它似乎这个问题用的是开发版本(当我安装IPython的这是最新的版本)。
So it would seem that this issue was using the dev version (which was the latest version when I installed IPython).
这篇关于神奇的功能``bash的未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!