elpy模式下,使用matplotlib绘图后无法响应的问题

本小白使用的是elpy mode编辑python,但是使用matplotlib库绘图并关闭之后,输入任何指令都无法响应,请教各位大神,这是为什么?谢谢!

我也是。

使用的是elpy mode编辑python,

楼主的是操作系统, emacs 版本, python 版本,楼主是怎样编辑的? 操作步骤是什么?被操作的代码是什么?有怎样的依赖?

楼主的 emacs 是什么版本的,从什么地方下载的?有没有使用别人的配置?还是自己的?加载了什么 major/min-mode?

但是使用matplotlib库绘图并关闭之后,

怎样关闭的?

输入任何指令都无法响应, 可能是还在跑循环?

请教各位大神,这是为什么?谢谢!

请提供尽可能详细的信息。否则,我们的工作量实在是太大了。

1 个赞

谢谢大神指点,我仔细写下

情况是这样,本小白的系统是win7,python版本3.8.1,emacs版本26.1,其配置文件是本人网上百度搜集的,如下

;; Added by Package.el. This must come before configurations of ;; installed packages. Don’t delete this line. If you don’t want it, ;; just comment it out by adding a semicolon to the start of the line. ;; You may delete these explanatory comments. (require 'package) (add-to-list 'package-archives '(“melpa” . “Package Listing”)) (package-initialize)

(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won’t work right. '(ansi-color-faces-vector [default default default italic underline success warning error]) '(ansi-color-names-vector [“#242424” “#e5786d” “#95e454” “#cae682” “#8ac6f2” “#333366” “#ccaa8f” “#f6f3e8”]) '(column-number-mode t) '(compilation-message-face (quote default)) '(custom-enabled-themes (quote (nyx))) '(custom-safe-themes (quote (“3cd4f09a44fe31e6dd65af9eb1f10dc00d5c2f1db31a427713a1784d7db7fdfc” “37ba833442e0c5155a46df21446cadbe623440ccb6bbd61382eb869a2b9e9bf9” “82fcf40c97214065e9706830263409a3a2c6a30e074cf2a4afe6cdc99eca740e” default))) '(fci-rule-color “#323342”) '(highlight-changes-colors (quote (“#ff8eff” “#ab7eff”))) '(highlight-tail-colors (quote ((“#323342” . 0) (“#63de5d” . 20) (“#4BBEAE” . 30) (“#1DB4D0” . 50) (“#9A8F21” . 60) (“#A75B00” . 70) (“#F309DF” . 85) (“#323342” . 100)))) '(magit-diff-use-overlays nil) '(package-selected-packages (quote (nyx-theme darkokai-theme danneskjold-theme elpy company))) '(pos-tip-background-color “#E6DB74”) '(pos-tip-foreground-color “#242728”) '(vc-annotate-background nil) '(vc-annotate-color-map (quote ((20 . “#ff0066”) (40 . “#CF4F1F”) (60 . “#C26C0F”) (80 . “#E6DB74”) (100 . “#AB8C00”) (120 . “#A18F00”) (140 . “#989200”) (160 . “#8E9500”) (180 . “#63de5d”) (200 . “#729A1E”) (220 . “#609C3C”) (240 . “#4E9D5B”) (260 . “#3C9F79”) (280 . “#53f2dc”) (300 . “#299BA6”) (320 . “#2896B5”) (340 . “#2790C3”) (360 . “#06d8ff”)))) '(vc-annotate-very-old-color nil) '(weechat-color-list (unspecified “#242728” “#323342” “#F70057” “#ff0066” “#86C30D” “#63de5d” “#BEB244” “#E6DB74” “#40CAE4” “#06d8ff” “#FF61FF” “#ff8eff” “#00b2ac” “#53f2dc” “#f8fbfc” “#ffffff”))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won’t work right. '(default ((t (:family “Courier New” :foundry “outline” :slant normal :weight normal :height 158 :width normal)))))

(require 'package) (add-to-list 'package-archives '(“melpa” . “Package Listing”))

(elpy-enable)

(setq-default cursor-type 'bar) (global-linum-mode t) (column-number-mode t) (setq inhibit-splash-screen 1) (setq initial-frame-alist (quote ((fullscreen . maximized)))) (setq electric-pair-pairs '( (?" . ?") (?{ . ?}))) (electric-pair-mode 1)

上图,是使用matplotlib库绘制基础图形,图形窗口能够正常显示,在点击窗口右上方X关闭窗口后,输入指令无法响应,下方窗口最后一行代码在python交互模式下,输入print(‘Hello, World!’)没有任何响应的图示。

情况就是这样,麻烦您了,多谢!

(elpy-enable)
(setq python-shell-interpreter "ipython3"
    python-shell-interpreter-args "--simple-prompt -i")

再试一下

2 个赞

厉害!!感谢大神!!问题完美解决了 :+1: :+1: :+1: