From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Federico Beffa Newsgroups: gmane.emacs.bugs Subject: bug#18052: closed (Re: bug#18052: 24.3; python.el and ipython shell) Date: Sun, 20 Jul 2014 18:26:24 +0200 Message-ID: References: <878unoy3dt.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1405873649 20031 80.91.229.3 (20 Jul 2014 16:27:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jul 2014 16:27:29 +0000 (UTC) To: 18052@debbugs.gnu.org, =?UTF-8?Q?Fabi=C3=A1n?= Ezequiel Gallina Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 20 18:27:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X8txM-00056w-Aw for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jul 2014 18:27:24 +0200 Original-Received: from localhost ([::1]:58354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8txL-0006So-Uu for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Jul 2014 12:27:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8txB-0006Rs-Fo for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 12:27:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8tx0-0000FG-GC for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 12:27:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8tx0-0000Eg-Bg for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 12:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X8twz-0007nm-V1 for bug-gnu-emacs@gnu.org; Sun, 20 Jul 2014 12:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Federico Beffa Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Jul 2014 16:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18052 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18052-submit@debbugs.gnu.org id=B18052.140587359529948 (code B ref 18052); Sun, 20 Jul 2014 16:27:01 +0000 Original-Received: (at 18052) by debbugs.gnu.org; 20 Jul 2014 16:26:35 +0000 Original-Received: from localhost ([127.0.0.1]:60504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8twX-0007mu-Hh for submit@debbugs.gnu.org; Sun, 20 Jul 2014 12:26:34 -0400 Original-Received: from mail-la0-f47.google.com ([209.85.215.47]:57788) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8twV-0007mX-0c for 18052@debbugs.gnu.org; Sun, 20 Jul 2014 12:26:32 -0400 Original-Received: by mail-la0-f47.google.com with SMTP id mc6so4196135lab.34 for <18052@debbugs.gnu.org>; Sun, 20 Jul 2014 09:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=JRiB27VLBRbabEqgt8ASjmtusnLQpvvoPVncw5/0dOo=; b=CbasHR1tn1YIsycXMPDNX0F6aKiaIaX4YdY4dOd7r+TKcyvRyeYgA/bQzehT/P8g4s oLCs6C4UcmRB0ZjjBd4PUQprKG+4EPI9Nh1tgmIT8v5h/pq5W8wqa1VTWgAA57oLqnTv 4Mq/f+G9l2mcpbVbSeBfvbAuopfuZbTuOsvOKS2yH5HVsB6ztBO86mPyp09PyrMuZf36 H+4gn6y+JL5mCLsiojtXMgaVhyIEbygt1iuMdX7AjWe/NLzlbHAP1zxDLaWn3iciX9hM SfTRlOACCpfXF8HsospoVy2zQjGngbGXQZ4LeIXxLo/9JizAWApD1miP0QHxZkqPk3hN +z+w== X-Received: by 10.152.28.136 with SMTP id b8mr20192184lah.22.1405873584676; Sun, 20 Jul 2014 09:26:24 -0700 (PDT) Original-Received: by 10.114.18.44 with HTTP; Sun, 20 Jul 2014 09:26:24 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: amwtNozpxHoNT056ZTTxnC4R-aw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91707 Archived-At: Hi, I would like to add that without the "console" argument, the interactive matplotlib plotting capabilities do not work. Regards, Fede On Sun, Jul 20, 2014 at 3:49 PM, Federico Beffa wrote: > I can confirm that removing "console" resolves the problem. > > Thank you very much for the help! > Best Regards, > Fede > > On Sun, Jul 20, 2014 at 8:03 AM, GNU bug Tracking System > wrote: >> Your bug report >> >> #18052: 24.3; python.el and ipython shell >> >> which was filed against the emacs package, has been closed. >> >> The explanation is attached below, along with your original report. >> If you require more details, please reply to 18052@debbugs.gnu.org. >> >> -- >> 18052: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18052 >> GNU Bug Tracking System >> Contact help-debbugs@gnu.org with problems >> >> >> ---------- Forwarded message ---------- >> From: fgallina@gnu.org (Fabi=C3=A1n Ezequiel Gallina) >> To: Federico Beffa >> Cc: 18052-done@debbugs.gnu.org >> Date: Sun, 20 Jul 2014 03:02:06 -0300 >> Subject: Re: bug#18052: 24.3; python.el and ipython shell >> Federico Beffa writes: >> >>> Unfortunately it does not. I see the same intermittent problem as >>> without the "-u" option. >>> >> >> So I tracked down what's going on. Removing "console" from your >> `python-shell-interpreter-args' should do the trick. >> >> The "console" subcommand, starts an iPython server (AKA kernel) and then >> connects the client console to it (that's the reason you see two >> processes). Removing the "console" subcommand just starts a standalone >> iPython shell that doesn't suffer from this intermittent initialization >> problem. >> >> Now the reason why the console subcommand fails seems to be an iPython >> bug itself. What happens is that python.el shell setup codes are sent >> quickly as soon as the inferior process starts, but it seems that >> sometimes the iPython kernel startup doesn't expect that and fails to >> start properly, thus causing the resulting iPython shell to be non >> responsive. >> >> This is not particularly a problem of python.el, in fact the issue can >> be replicated in the commandline by spawning processes like so: >> >> echo "print ('yes')" | ipython console >> >> With that, I get the same intermittent behavior observed previously. So >> my suggestion is to report this bug upstream. >> >> In the meantime, I'll include some notes about this in the header of >> python.el. >> >> >> PS: As you may expect, when an iPython kernel is already started, using >> "console --existing" works reliably, this may be useful in case you >> really needed the client-server mode. >> >> >> >> Cheers, >> Fabi=C3=A1n >> >> >> >> ---------- Forwarded message ---------- >> From: Federico Beffa >> To: bug-gnu-emacs@gnu.org >> Cc: >> Date: Fri, 18 Jul 2014 15:51:47 +0200 >> Subject: 24.3; python.el and ipython shell >> I'm trying to use the ipython shell from within emacs. To do so I've >> followed the instructions at the top of python.el and added the >> following code to my .emacs: >> >> (setq >> python-shell-interpreter "C:/Anaconda/python.exe" >> python-shell-interpreter-args >> "-i C:/Anaconda/Scripts/ipython-script.py console --matplotlib=3Dqt" >> 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") >> >> When I execute (M-x) run-python, SOMETIMES the session does not >> initialize properly and the new buffer looks like this: >> >> ----------------------------------------------------------- >> Python 2.7.6 |Anaconda 2.0.1 (64-bit)| (default, Nov 11 2013, >> 10:49:15) [MSC v.1500 64 bit (AMD64)] >> Type "copyright", "credits" or "license" for more information. >> >> IPython 2.1.0 -- An enhanced Interactive Python. >> Anaconda is brought to you by Continuum Analytics. >> Please check out: http://continuum.io/thanks and https://binstar.org >> ? -> Introduction and overview of IPython's features. >> %quickref -> Quick reference. >> help -> Python's own help system. >> object? -> Details about 'object', use 'object??' for extra details. >> >> In [1]: >> ----------------------------------------------------------- >> >> The difference compared to the situation when everything is well, is >> that here I only see "In [1]:", while normally I should see 4 empty >> input prompts, with the last one reading "In [4]". When I execute any >> command such as "1+1" and press RET, nothing happens. >> >> This happens starting emacs with the -Q option and executing the ipython >> customization in the *scratch* buffer. >> >> By running the debugger I've found out that emacs sends some commands to >> the inferior python shell with (comint-send-string ...) and tries to >> hide them from the user. That appears to be the reason for the four >> empty prompts. >> >> Looking at the running processes I've noted that there are 2 python >> processes running. The task manager reports one as: >> c:\Anaconda\python.exe -c"from IPython.kernel.zmq.kernelapp import main; >> main()" -f >> C:\Users\beffa\.ipython\profile_default\security\kernel-976.json >> --matplotlib=3Dqt --IPKernelApp.parent_appname=3D'ipython-console' >> --interrupt=3D692 --parent=3D696 >> >> (Obviously the value of the last two arguments change everytime.) >> If I kill this process, the inferior python shell asks: >> >> "kernel died, restart ([y]/n)? kernel died, restart ([y]/n)? kernel >> died, restart ([y]/n)?" >> >> If I press y the process is restarted and the inferior python shell >> works fine (or at least responds to the commands like 1+1 that I've >> tried). >> >> I would greatly appreciate any suggestion on how to further dig into >> debugging and solve this intermittent problem. >> >> Thank you in advance for your help. >> Fede >> >> >> In GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) >> of 2013-03-17 on MARVIN >> Windowing system distributor `Microsoft Corp.', version 6.1.7601 >> Configured using: >> `configure --with-gcc (4.7) --cflags >> -ID:/devel/emacs/libs/libXpm-3.5.8/include >> -ID:/devel/emacs/libs/libXpm-3.5.8/src >> -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include >> -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include >> -ID:/devel/emacs/libs/giflib-4.1.4-1/include >> -ID:/devel/emacs/libs/jpeg-6b-4/include >> -ID:/devel/emacs/libs/tiff-3.8.2-1/include >> -ID:/devel/emacs/libs/gnutls-3.0.9/include >> -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include >> -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2' >> >> Important settings: >> value of $LANG: ENU >> locale-coding-system: cp1252 >> default enable-multibyte-characters: t >> >> Major mode: Lisp Interaction >> >> Minor modes in effect: >> show-paren-mode: t >> tooltip-mode: t >> mouse-wheel-mode: t >> tool-bar-mode: t >> menu-bar-mode: t >> file-name-shadow-mode: t >> global-font-lock-mode: t >> font-lock-mode: t >> blink-cursor-mode: t >> auto-composition-mode: t >> auto-encryption-mode: t >> auto-compression-mode: t >> line-number-mode: t >> transient-mark-mode: t >> >> Recent input: >> C-x C-r C-SPC C-a C-w c : / p r o >> SPC SPC e m 3 s i s i >> d f >> >> >> >> >> C-SPC >> >> M-w C-x b >> C-y M-x s h o w - p a C-x C-e M-x r >> u n - p y C-x k y e s >> C-x 0 M-x r u n - p y >> C-x o M-x r e p o r > n> >> >> Recent messages: >> "';'.join(get_ipython().Completer.all_completions('''%s''')) >> " >> Sent python-shell-completion-setup-code >> Sent python-ffap-setup-code >> Sent python-eldoc-setup-code >> Making completion list... >> Sent python-shell-completion-setup-code >> Sent python-ffap-setup-code >> Sent python-eldoc-setup-code >> Making completion list... >> >> Load-path shadows: >> None found. >> >> Features: >> (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml >> mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev >> gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util >> mail-prsvr mail-utils help-mode compile python rx easymenu comint ring >> ansi-color cus-start cus-load paren time-date tooltip ediff-hook >> vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns >> disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe >> tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow >> timer select scroll-bar mouse jit-lock font-lock syntax facemenu >> font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan >> thai tai-viet lao korean japanese hebrew greek romanian slovak czech >> european ethiopic indian cyrillic chinese case-table epa-hook >> jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces >> cus-face macroexp files text-properties overlay sha1 md5 base64 format >> env code-pages mule custom widget hashtable-print-readable backquote >> make-network-process w32 multi-tty emacs) >> >> >>