Python Segmentation fault: 11 on OSX

  • Post author:
  • Post category:python

问题描述

这是一个bug引起的。以下是该问题的描述:

Modules/readline.c contains a workaround for a bug in the readline emulation of libedit: that emulation uses a different starting offset for the history than the real readline.

解决方法

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

如果使用的是Homebrew,则路径为

/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/V‌​ersions/2.7/lib/pyth‌​on2.7/lib-dynload

具体路径可能和实际版本有关系,请自己追寻。


[1] http://stackoverflow.com/questions/18768967/python-segmentation-fault-11-on-osx
[2] http://www.dannysite.com/blog/198/