1

When I run code from a buffer in python-mode for it to evaluate in a dedicated inferior ipython process emacs freezes. It freezes if, while the code is evaluating, I try to edit the buffer from which I sent the code. I am unable to move the point, am unable to change buffers, am unable to type, and the time in the mode-line does not update.

What can I do to stop this from happening? Could it be related to the settings of my python-shell-interpreter?

Here is my python init

(use-package python
  :mode ("\\.py\\'" . python-mode)
  :interpreter ("ipython" . python-mode)
  :demand
  :config
  (setq python-shell-interpreter "ipython"
    python-shell-interpreter-args "-i"))

Thank you!

  • Which emacs version are you using? It is running correctly in emacs 25. You can also try elpy. – ChillarAnand Mar 5 '16 at 10:06
  • Hi, Sorry for the delayed response. My version is GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.28) of 2016-01-04. I feel like it should work as is. I've seen people mention adding --pylab as an argument – Jules Mar 7 '16 at 14:25
  • I'm also a user of use-package but I don't use it for loading python, given that the mode is a builtin it will be initialized automatically when I open a .py file or buffer. So in my config to use ipython I just do the following: (setq python-shell-interpreter "ipython") assuming that your path is setup correctly, this just works for me in emacs 25.1 – xmonk Apr 29 '16 at 22:37
  • That did not work for me. For example if I run a file that is simply "while True: 2+2" and I try to edit that file while it is running I have to do a keyboard interupt to unfreeze emacs – Jules May 2 '16 at 16:44
0

Okay so I figured out what the problem was! I asked this over a month ago and recently solved it. If anybody else runs across this problem I want them to know that there is a solution.

The problem comes from eldoc-mode and/or global-eldoc-mode. Global-eldoc-mode is on by default in emacs 25 and that is why it was not an issue in emacs 24 despite the fact that this has been a long lasting bug. The issue was that emacs would request the documentation from the process automatically because of eldoc-mode but would then hangup if the interpetter was busy. This issue is now fixed in the emacs-25 branch on git and it will be included in the next pretest and in the release of emacs.

What emacs now does it simply timeout and stop eldoc mode from requesting the documentation if it ever times out. This feature can be configured with python-eldoc-function-timeout python-eldoc-get-doc and python-eldoc-function-timeout-permanent.

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.