Question

I've updated my system to OS X Mavericks, just now when I tried to use hashlib module a strange Segmentation fault Raised. I've tried to rebuild the python3.3.2 and reinstall it again but it didn't help. So how could I fix this annoying problem? The out put looks like below:

ZZ:Python-3.3.2 zhangzhao$ python3
Python 3.3.2 (default, Oct 28 2013, 16:27:26) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> a = hashlib.md5()
Segmentation fault: 11
Was it helpful?

Solution

There are known problems with Python 3.3.2 and Mavericks. Please try Python 3.3.3rc1 as this may fix thes problem:

This release fully supports OS X 10.9 Mavericks. In particular, this release fixes an issue that could cause previous versions of Python to crash when typing in interactive mode on OS X 10.9

OTHER TIPS

I had the same problem & found the answer here: python3 segmentation fault on osx mavericks

------> 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

<------------

This same problem happens with both Python2.7.5 and python3.3.2 for OSX Mavericks 10.9. It was driving me nuts. I couldn't even assign and then invoke a simple variable without crashing the interpreter.

>>> a = 7
>>> a
Segmentation fault: 11  

It is bug discussed at issue18458

The patched versions for OSX Mavericks can be found below for Python 2 and 3 respectively.

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top