【发布时间】:2014-05-06 17:51:17
【问题描述】:
我喜欢 Emacs,但我无法使用 Windows 7。我已经安装了 Cygwin,并且可以使用 Emacs 来完成基本的编辑任务。我可以将 Emacs 设置为运行 IPython 的 Cygwin 安装,但我宁愿运行 IPython 的 Enthought Python Distribution 版本。
根据here 的建议,我将以下内容添加到我的~/.emacs 文件中:
(when (executable-find "ipython")
(setq
python-shell-interpreter "/cygdrive/c/Python27/Scripts/ipython.bat"
python-shell-interpreter-args ""
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
python-shell-completion-setup-code
"from IPython.core.completerlib import module_completion"
python-shell-completion-module-string-code
"';'.join(module_completion('''%s'''))\n"
python-shell-completion-string-code
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n"))
注意我修改了第三行指向ipython.bat。然后我启动了解释器,它加载了 EPD,但是我得到了以下错误并且不能做任何事情:
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
C:\Users\username\My Documents\python\<ipython-input-2-6552ae2ca310> in <module>()
----> 1 __pyfile = open('''/tmp/py6644bAS''');exec(compile(__pyfile.read(), '''/tmp/py6644bAS''', 'exec'));__pyfile.close()
IOError: [Errno 2] No such file or directory: '/tmp/py6644bAS'
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
C:\Users\username\My Documents\python\<ipython-input-3-492fce3681b4> in <module>()
----> 1 __pyfile = open('''/tmp/py6644XOK''');exec(compile(__pyfile.read(), '''/tmp/py6644XOK''', 'exec'));__pyfile.close()
IOError: [Errno 2] No such file or directory: '/tmp/py6644XOK'
有什么想法或其他方法可以让我通过 Cygwin 在 Emacs 中运行 EPD 的 IPython 安装吗?
【问题讨论】:
标签: emacs cygwin ipython enthought