在 iMac 上从 Emacs 运行 Octave
Octave 安装在我的 iMac 上的 /applications
中并正常工作。
Emacs 安装在我的 iMac 上的 /applications
中,并且可以编辑文件。
现在我想从 Emacs 运行 Octave。 Mxrun-octave
结果:
Searching for program: No such file or directory, octave
在 Windows 中,我通过将 Octave 添加到环境路径解决了这个问题,如何在 Mac 上执行此操作?
预先感谢汉斯·塞尔梅杰
Octave is installed on my iMac in /applications
and works properly.
Emacs is installed on my iMac in /applications
and file editing is possible.
Now I want to run Octave from Emacs. M-xrun-octave
results in:
Searching for program: No such file or directory, octave
In Windows I solved this problem by adding Octave to the environment path, how can I do this on a Mac?
Thank in advance, Hans Sellmeijer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下是两种可能的解决方案:
通过在 shell 中输入
which Octave
查找实际的 Octave 可执行文件。例如,如果通过 Macports 安装,则位于/opt/local/bin/octave
。然后,在 Emacs 中,执行Mxcustomize-group RET Octave-inferior RET
,将Inferior Octave Program
的值编辑为此值,然后单击State > 。保存以供将来使用
。或者,您可以在 Elisp 中执行此操作,方法是将以下内容放入
.emacs
或init.el
文件中(显然,根据需要更改引用的部分):(setq lower-octave-program "/opt/local/bin/octave")
你可以像在 Windows 上一样将 Octave 添加到 PATH 环境变量中,但在 Mac OS X 下从 Finder 启动的 Emacs 则不能获取任何环境设置您可能已经输入了
.bashrc
或类似内容。从终端窗口运行 Emacs,或者放入 .emacs:(add-to-list 'exec-path "/opt/local/bin")
希望有所帮助。
Here are two possible solutions:
Find the actual Octave executable by typing
which octave
in your shell. E.g., if installed via Macports it's at/opt/local/bin/octave
. Then, in Emacs, doM-x customize-group RET octave-inferior RET
, edit the value ofInferior Octave Program
to this value and clickState > Save for Future Sessions
.Alternatively, you can do this in Elisp by putting the following in your
.emacs
orinit.el
file (obviously changing the quoted part as necessary):(setq inferior-octave-program "/opt/local/bin/octave")
You can add octave to the PATH environment variable just as on Windows, but Emacs started from the Finder under Mac OS X doesn't get any environment settings that you might have put in
.bashrc
or similar. Either run Emacs from a terminal window, or put in your .emacs:(add-to-list 'exec-path "/opt/local/bin")
Hope that helps.
感谢 Jon,Emacs 可以在带有 Snow-Leopard 的 iMac 上正确处理 Octave。 “.emacs”文件包含:
从 .PDF 手册复制这些行时要小心。引用被变形为转义序列,这削弱了正确的使用。
Thanks to Jon, Emacs handles Octave properly on iMac with Snow-Leopard. The ".emacs" file contains:
Be careful with copying these lines from a .PDF manual. The quote is deformed to escape sequences, which cripples proper use.
这就是我如何在 Mac (OS X 10.7.3) 上的 Emacs 中运行 Octave(包括绘图):
fink install Octave
。这还安装了 gnuplot 的所有依赖项,二进制发行版似乎没有正确执行该操作(至少,它对我不起作用)。唯一的缺点是在我的 MacBook Air 上安装需要几个小时才能完成。.emacs
中自定义octave-inferior
:(此列表中可能有更多变量):This is how I was able to get Octave (including plots) running in Emacs on my Mac (OS X 10.7.3):
fink install octave
. This also installed all the dependencies for gnuplot, which the binary distribution does not seem to do correctly (at least, it didn't work for me). Only downside is that the install took several hours to complete on my MacBook Air.octave-inferior
in.emacs
: (you may have more variables in this list):