python3 segmentation fault on osx mavericks

2019-06-22 13:12发布

I have been experience segmentation faults when using Python3 on OS X Mavericks. Any suggestions on how to resolve this?

I have tried to reinstall the package from the Python site, but this is ineffective. How would one recompile Python3 on the system?

3条回答
仙女界的扛把子
2楼-- · 2019-06-22 13:32

This problem exists because of this bug: http://bugs.python.org/issue18458.

Basically, Python has code in Modules/readline.c that contains a workaround for a bug in libedit, however the bug in libedit was fixed and Mavericks comes with the new version of libedit and the workaround now causes ython to segfault. The quick and dirty fix is to disable deadline processing by running the following command (from the bug document):

curl -O http://bugs.python.org/file32324/patch_readline_issue_18458.sh
openssl sha1 patch_readline_issue_18458.sh
# the digest should be 7cb0ff57820a027dd4ca242eb2418930f8f46b4c
sudo sh ./patch_readline_issue_18458.sh
查看更多
一夜七次
3楼-- · 2019-06-22 13:41

The problem with that fix is that you loose many of Python's interactive features. Read this article for a more permanent fix: http://paulbramsen.com/archives/125

查看更多
Lonely孤独者°
4楼-- · 2019-06-22 13:43

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

you can follow the instructions on the main python page for a quick and permanent fix. cheers,

查看更多
登录 后发表回答