ipython: ipython in terminal freezes on OS X El Capitan

I installed ipython 4.0.1 from macports on OS X El Capitan. The interactive ipython terminal regularly freezes for a while in a way that is reminiscent of what I remember from a few years ago, that I thought was fixed with #6325. It eventually recovers, usually if I focus on another window for a while.

Any ideas? Any more info I can provide to help?

I have matplotlib loaded with the MacOSX backend.

Version info:

In [3]: print(IPython.sys_info())
{'commit_hash': u'03b6385',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython',
 'ipython_version': '4.0.1',
 'os_name': 'posix',
 'platform': 'Darwin-15.2.0-x86_64-i386-64bit',
 'sys_executable': '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python',
 'sys_platform': 'darwin',
 'sys_version': '2.7.11 (default, Dec 31 2015, 13:28:45) \n[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]'}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 29 (9 by maintainers)

Most upvoted comments

Using matplotlib backend: MacOSX

I might have the same problem. If I press and hold any key (arrows or letters) the input freezes. Although if I hit CTRL+C the input unfreezes, I and can continue to type. The problem only happens if matplotlib is loaded (invoke with $> ipython --matplotlib or %matplotlib after loading).

The problem seems related to the Keyboard -> Key Repeat setting in the System Preferences. I only experience the keyboard freeze using the two fastest settings. By setting to the third fastest, the problem goes way (see figure).

key repeat

I am running: Python 3.5.1 IPython 4.0.1 Matplotlib 1.5.1 MacOS 10.11.3

For what it’s worth, this issue seems to have disappeared with the magnificent and glorioius IPython 5.0. I vote to close.

I’ve been having the same issue for a couple weeks now. I am always able to unlock it by hitting <CTRL-C> then <enter>. Whatever had been displayed before is in the history, so I can get back to where I was with <up>, but my session is littered with:

In [56]: xy =

KeyboardInterrupt

In [56]: xy = vor.points

In [57]: from scipy.spa
scipy.spacing  scipy.sparse   scipy.spatial

In [57]: from scipy.spatial import

KeyboardInterrupt

In [57]: from scipy.spatial import Co

KeyboardInterrupt

In [57]: from scipy.spatial import ConvexHull

So far, this is all I can gather:

  1. Problem occurs if I run ipython --pylab or if I run ipython then later run %matplotlib, but so far I think not otherwise.
  2. When it does occur, I can always free the interface and get the prompt back with <CTRL-C><enter>, but nothing else has worked. I tried other suggestions from this issue page, but <CTRL-A> and <CTRL-E> do not work. Waiting (for a few minutes) and clicking in and out of the terminal do not work.
  3. It happens without using arrow keys, just alphanumeric keys are sufficient. However, it seems to only happen when I’m typing the start of something defined. That is, if I jam keys randomly, it is fine, but if I type np it can freeze. This is not so certain, and hard to test since the freezing is inconsistent. It can happen when hitting <Tab> as well, which is especially annoying, since I first think <Tab> is doing nothing because I’ve misspelled something so no completion exists, but it turns out it’s frozen, so I have to hit <CTRL-C><enter><up>, then <Tab> works.
  4. My keyboard repeat rate and delay are both set to the fastest setting. However, holding any keys down or typing randomly really fast do not induce the problem. I also have the problem happen at the settings shown in @rrbarbosa 's image.

Here’s all the information that I can think of to provide:

OS X El Capitan 10.11.3
iTerm2 Build 2.9.20160206
IPython 4.0.3
python 2.7.11
matplotlib 1.5.1 (backend 'MacOSX')

IPython.sys_info()
{'commit_hash': u'8ff8693',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '4.0.3',
 'os_name': 'posix',
 'platform': 'Darwin-15.3.0-x86_64-i386-64bit',
 'sys_executable': '/usr/local/opt/python/bin/python2.7',
 'sys_platform': 'darwin',
 'sys_version': '2.7.11 (default, Dec  8 2015, 17:52:46) \n[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)]'}

os.environ
{'DISPLAY': '/private/tmp/com.apple.launchd.wh7e6piUqu/org.macosforge.xquartz:0',
 'TERM_PROGRAM': 'iTerm.app',
 'LANG': 'en_US.UTF-8',
 'TERM': 'xterm-256color',
 'XPC_FLAGS': '0x0',
 'XPC_SERVICE_NAME': '0',
 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.2ITyyqMHxp/Listeners',
 'SHELL': '/usr/local/bin/fish',
 '__CF_USER_TEXT_ENCODING': '0x1F7:0x0:0x0'}