Python Segmentation fault: 11 on OSX Python Segmentation fault: 11 on OSX python python

Python Segmentation fault: 11 on OSX


Hmmm... spread the word. The following seems that it fixed it:

cd /Library/Frameworks/Python.framework/Versions/3.3 cd ./lib/python3.3/lib-dynload sudo mv readline.so readline.so.disabled 


This is a bug in the python interpreter related to readline compatibility that has been fixed in the most recent candidates that were cut this weekend.

http://python.org/download/releases/2.7.6/

http://python.org/download/releases/3.3.3/

The issue, quoting from Ned Deily, writing on the python-dev email list:

On Tuesday, Apple released OS X 10.9 (a.k.a. Mavericks). There has already been a lot of interest in it, in part because Apple has made it available for free and has made it easy for users with 10.8, 10.7, and (most) 10.6 systems to upgrade directly to 10.9. Unfortunately, there are issues with our current maintenance releases (3.3.2 and 2.7.5) on OS X 10.9 that call for new maintenance releases as soon as possible.

One is critical in that it causes the interpreter to crash when running in interactive mode (http://bugs.python.org/issue18458). The problem was due to a long-standing compatibility issue in libedit's readline compatibility layer that upstream has finally fixed and Apple has now shipped in 10.9. Because the python.org installers dynamically link to libedit, the original workaround in readline.c for the original design flaw in history indexing now causes a segfault on 10.9 when the user types in the second command interactively. Not good. Ronald devised a fix that allows readline.so at runtime to detect and work with either version of libedit so that we continue to have binary compatibility across multiple OS X releases. That fix is already out in the 3.4.0 alphas and backported to the 3.3 and 2.7 branches, awaiting release there. Just in the last 12 hours, there have been at least four duplicates of the issue reported by users. I've updated the original issue to explicitly mention 10.9, now that it is no longer under NDA, and to provide a downloadable script for inexperienced users to workaround the problem by "removing" readline.so. Presumably, as word gets out, there will be fewer duplicate issues opened but the impact will remain.


I hit this issue on El Capitan when I installed Homebrew and had to adjust my PATH variable to put /usr/local/bin up front. Python version in there was 2.7.3. Python in /usr/bin is 2.7.10. Removing the python symlink in /usr/local/bin/ did the trick.