我尝试在编辑 python 脚本时键入 C-c C-p 在 emacs 上启动 ipython 控制台。但 ipython 控制台看起来是空白的。尽管当我键入某些命令时会有输出并显示 Out 提示符。此外,当我 exit() 时,会显示许多 In() 提示。为什么会这样?
我使用的是 emacs 版本 24.3、ipython 2.1.0 和 python 2.7.6。以下是我的 init.el
;;; To start emacs maximized at startup
(w32-send-sys-command 61488)
;;; To remove the toolbar from emacs
(tool-bar-mode 0)
;;; IDO configuration
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
;;; Add MELPA repository
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
;;; Configure Aspell
(add-to-list 'exec-path "C:/Program Files (x86)/Aspell/bin/")
; Tell emacs to use Aspell and provide the location of custom dictionary
(setq ispell-program-name "aspell")
(setq ispell-personal-dictionary "C:/emacs/.emacs.d/my_dict/my_dict.ispell")
; Turn it on
(require 'ispell)
;;; Flyspell configuration
(add-to-list 'load-path "~/.emacs.d/flyspell")
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(autoload 'flyspell-delay-command "flyspell" "Delay on command." t)
(autoload 'tex-mode-flyspell-verify "flyspell" "" t)
(add-hook 'LaTeX-mode-hook 'flyspell-mode) ; Auto-start flyspell with LaTeX
;;; Enable auto-complete mode
(require 'auto-complete)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(require 'auto-complete-config)
(ac-config-default)
(global-auto-revert-mode t)
;;; RefTex configuration
(require 'reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'latex-mode-hook 'turn-on-reftex)
;;; Activate code folding in AUCTeX
(add-hook 'LaTeX-mode-hook (lambda ()
(TeX-fold-mode 1)))
;;; Setup jedi
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
;;; Pair braces and quotes automatically (autopair)
(require 'autopair)
(autopair-global-mode) ;; Enable autopair in all buffers
;; (setq py-install-directory "~/.emacs.d/python-mode.el-6.1.3")
;; (add-to-list 'load-path py-install-directory)
;; (require 'python-mode)
(require 'python)
(setq python-shell-interpreter "ipython")
(setq python-shell-interpreter-args "--pylab")
最佳答案
我对 python.el 代码不够熟悉,无法给你一个很好的答案,但是如果你看一下 python.el 的开头(“注释:”部分),你会发现它说了一些话关于如何使用 Ipython。这就是说,它存在各种问题。即将发布的 24.4 中的 python.el 代码显着改进了 Ipython 支持,因此它不需要所有配置并且实际上可以工作(据说)。由于 24.4 即将发布,我们正在寻找能够帮助我们消除最后几个错误的人,因此如果您可以尝试最新的预测试 (24.3.94) 看看是否能解决您的问题,那就太好了问题,如果没有,请执行 M-x report-emacs-bug
以便我们可以在发布之前修复它。
关于python - 在 emacs 中启动 ipython 时没有提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26041622/