【发布时间】:2012-02-01 19:17:22
【问题描述】:
所以我一直在尝试使用 numpy 和 matplotlib,并且在从 emacs 劣质 shell 运行 python 时偶然发现了一些错误。
当我将 py 文件发送到 shell 解释器时,我可以在代码执行后运行命令。命令提示符“>>>”看起来很好。但是,在我在绘图上调用 matplotlib show 命令后,shell 只是挂起,命令提示符不显示。
>>> plt.plot(x,u_k[1,:]);
[<matplotlib.lines.Line2D object at 0x0000000004A9A358>]
>>> plt.show();
我正在运行传统的 C-python 实现。在 emacs 23.3 下,在 Win7 上使用 F* Gallina 的 Python python.el v. 0.23.1。
在i-python平台下这里也提出过类似的问题:running matplotlib or enthought.mayavi.mlab from a py-shell inside emacs on windows
更新:我已经用 python 网站上提供的典型 python 2.7.2 二进制文件以及 emacs 23.3 和 23.4 上的 numpy 1.6.1 和 matplotlib 1.1.0 复制了新安装 Win 7 x64 的问题适用于 Windows。
emacs shell 中一定有错误。
【问题讨论】:
-
另外,如果我在从 windows 命令 shell 开始的 python 环境中运行相同的命令,一切正常。因此,给我带来麻烦的只是比 emacs 差的 python。
-
您是否尝试过使用
ansi-term或eshell我记得读过一些应用程序不喜欢M-x shell提供的IO 重定向。有关概述,请参阅此article on alternative shells。 -
如何在 emacs 中指定 python 在 eshell 或 ansi-term 而不是通过 M-x shell 调用的 shell 中运行?我没有看到教程指定的地方。
-
所以我也尝试了 python-mode.el 并且发生了相同的行为。那么也许我的 emacs 劣质外壳有问题?
标签: python emacs matplotlib