This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python quit unexpectedly error
Type: crash Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, kellena, methane, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2019-03-01 04:42 by kellena, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (10)
msg336892 - (view) Author: (kellena) Date: 2019-03-01 04:42
I'm on a Mac running Mojave, version 10.14.3. I installed Python 3.7. I'm now getting a "Python quit unexpectedly" error consistently and I don't know why or if I did something to cause it. I've tried uninstalling and reinstalling but I'm still getting the error. I've checked online resources such as Stack Overflow and "reinstall" is pretty much the standard suggestion, which I've already done.

Here's the full error. Please tell me how to fix this:

> Process:               Python [7756]
> Path:                  /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
> Identifier:            Python
> Version:               3.7.2 (3.7.2)
> Code Type:             X86-64 (Native)
> Parent Process:        Code Helper [785]
> Responsible:           Python [7756]
> User ID:               501
> 
> Date/Time:             2019-02-27 16:27:29.136 -0600
> OS Version:            Mac OS X 10.14.3 (18D109)
> Report Version:        12
> Bridge OS Version:     3.3 (16P3133)
> Anonymous UUID:        DB5CA6AD-7D99-F9D4-0475-D401946AB77E
> 
> Sleep/Wake UUID:       D7171268-D6D9-464C-B881-A97EE3C3AB2D
> 
> Time Awake Since Boot: 17000 seconds
> Time Since Wake:       420 seconds
> 
> System Integrity Protection: enabled
> 
> Crashed Thread:        0  Dispatch queue: com.apple.main-thread
> 
> Exception Type:        EXC_CRASH (SIGABRT)
> Exception Codes:       0x0000000000000000, 0x0000000000000000
> Exception Note:        EXC_CORPSE_NOTIFY
> 
> Application Specific Information:
> dyld2 mode
> abort() called
> 
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   libsystem_kernel.dylib            0x00007fff6b87723e __pthread_kill + 10
> 1   libsystem_pthread.dylib           0x00007fff6b92dc1c pthread_kill + 285
> 2   libsystem_c.dylib                 0x00007fff6b7e01c9 abort + 127
> 3   org.python.python                 0x00000001049ff420 fatal_error + 592
> 4   org.python.python                 0x00000001049fe784 _Py_FatalInitError + 36
> 5   org.python.python                 0x0000000104a27031 pymain_main + 7921
> 6   org.python.python                 0x0000000104a2713a _Py_UnixMain + 58
> 7   libdyld.dylib                     0x00007fff6b737ed9 start + 1
> 
> Thread 0 crashed with X86 Thread State (64-bit):
>   rax: 0x0000000000000000  rbx: 0x000000010b3955c0  rcx: 0x00007ffeeb313e88  rdx: 0x0000000000000000
>   rdi: 0x0000000000000307  rsi: 0x0000000000000006  rbp: 0x00007ffeeb313ec0  rsp: 0x00007ffeeb313e88
>    r8: 0x0000000000000000   r9: 0x00000000b7d055e4  r10: 0x0000000000000000  r11: 0x0000000000000206
>   r12: 0x0000000000000307  r13: 0x00007fff9e5139a0  r14: 0x0000000000000006  r15: 0x000000000000002d
>   rip: 0x00007fff6b87723e  rfl: 0x0000000000000206  cr2: 0x00007fff9e511188
>   
> Logical CPU:     0
> Error Code:      0x02000148
> Trap Number:     133
> 
> 
> Binary Images:
>        0x1048eb000 -        0x1048ebfff +org.python.python (3.7.2 - 3.7.2) <122E5A60-3D65-3759-AD3F-54658AA10863> /Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
>        0x1048f3000 -        0x104accff7 +org.python.python (3.7.2, [c] 2001-2018 Python Software Foundation. - 3.7.2) <779A7040-54B9-3956-85A6-C3CFE0C5A52A> /Library/Frameworks/Python.framework/Versions/3.7/Python
>        0x10b2df000 -        0x10b35da87  dyld (655.1) <3EBA447F-A546-366B-B302-8DC3B21A3E30> /usr/lib/dyld
>     0x7fff3e4af000 -     0x7fff3e8fcfef  com.apple.CoreFoundation (6.9 - 1562) <02A2C178-9FF6-385C-A9C5-7F4FC9D66311> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
>     0x7fff687f9000 -     0x7fff687faff7  libDiagnosticMessagesClient.dylib (107) <15210AC0-61F9-3F9D-A159-A009F62EB537> /usr/lib/libDiagnosticMessagesClient.dylib
>     0x7fff68bab000 -     0x7fff68bacffb  libSystem.B.dylib (1252.200.5) <C6201660-5E17-397D-BA21-C503420CD706> /usr/lib/libSystem.B.dylib
>     0x7fff68e05000 -     0x7fff68e5cff7  libc++.1.dylib (400.9.4) <B260AC33-EB9A-30C6-8746-D011B3B02B08> /usr/lib/libc++.1.dylib
>     0x7fff68e5d000 -     0x7fff68e72fff  libc++abi.dylib (400.17) <446F4748-8A89-3D2E-AE1C-27EEBE93A8AB> /usr/lib/libc++abi.dylib
>     0x7fff69ac1000 -     0x7fff69d24ffb  libicucore.A.dylib (62109.0.1) <FEB89BD3-79C4-3208-A754-7E6BC4D38548> /usr/lib/libicucore.A.dylib
>     0x7fff6a653000 -     0x7fff6add9fe7  libobjc.A.dylib (750.1) <804715F4-F52D-34D0-8FEC-A25DC08513C3> /usr/lib/libobjc.A.dylib
>     0x7fff6b536000 -     0x7fff6b548ffb  libz.1.dylib (70.200.4) <15F7B40A-424C-33BB-BF2C-7E8195128B78> /usr/lib/libz.1.dylib
>     0x7fff6b5b9000 -     0x7fff6b5bdff3  libcache.dylib (81) <704331AC-E43D-343A-8C24-39201142AF27> /usr/lib/system/libcache.dylib
>     0x7fff6b5be000 -     0x7fff6b5c8ff3  libcommonCrypto.dylib (60118.220.1) <9C865644-EE9A-3662-AB77-7C8A5E561784> /usr/lib/system/libcommonCrypto.dylib
>     0x7fff6b5c9000 -     0x7fff6b5d0fff  libcompiler_rt.dylib (63.4) <817772E3-E836-3FFD-A39B-BDCD1C357221> /usr/lib/system/libcompiler_rt.dylib
>     0x7fff6b5d1000 -     0x7fff6b5daff3  libcopyfile.dylib (146.200.3) <5C5C4F35-DAB7-3CF1-940F-F47192AB8289> /usr/lib/system/libcopyfile.dylib
>     0x7fff6b5db000 -     0x7fff6b65ffdf  libcorecrypto.dylib (602.230.1) <C78D1A87-5543-3561-BEB4-3B480BA94ECB> /usr/lib/system/libcorecrypto.dylib
>     0x7fff6b6e6000 -     0x7fff6b720ff7  libdispatch.dylib (1008.220.2) <2FDB1401-5119-3DF0-91F5-F4E105F00CD7> /usr/lib/system/libdispatch.dylib
>     0x7fff6b721000 -     0x7fff6b750ff3  libdyld.dylib (655.1) <90C801E7-5D05-37A8-810C-B58E8C53953A> /usr/lib/system/libdyld.dylib
>     0x7fff6b751000 -     0x7fff6b751ffb  libkeymgr.dylib (30) <A4EFD9A4-2EF3-3E18-B325-F527E3821939> /usr/lib/system/libkeymgr.dylib
>     0x7fff6b75f000 -     0x7fff6b75fff7  liblaunch.dylib (1336.240.2) <D5F0014D-CF46-3B04-9DE0-A1466DA14A2C> /usr/lib/system/liblaunch.dylib
>     0x7fff6b760000 -     0x7fff6b765fff  libmacho.dylib (921) <6ADB99F3-D142-3A0A-B3CE-031354766ACC> /usr/lib/system/libmacho.dylib
>     0x7fff6b766000 -     0x7fff6b768ffb  libquarantine.dylib (86.220.1) <58524FD7-63C5-38E0-9D90-845A79551C14> /usr/lib/system/libquarantine.dylib
>     0x7fff6b769000 -     0x7fff6b76aff3  libremovefile.dylib (45.200.2) <BA53CA8A-9974-3A43-9265-B110B1AE470F> /usr/lib/system/libremovefile.dylib
>     0x7fff6b76b000 -     0x7fff6b782ff3  libsystem_asl.dylib (356.200.4) <33C62769-1242-3BC1-9459-13CBCDECC7FE> /usr/lib/system/libsystem_asl.dylib
>     0x7fff6b783000 -     0x7fff6b783fff  libsystem_blocks.dylib (73) <152EDADF-7D94-35F2-89B7-E66DCD945BBA> /usr/lib/system/libsystem_blocks.dylib
>     0x7fff6b784000 -     0x7fff6b80cfff  libsystem_c.dylib (1272.200.26) <D6C701A2-9F17-308D-B6AC-9E17EF31B7DF> /usr/lib/system/libsystem_c.dylib
>     0x7fff6b80d000 -     0x7fff6b810ff7  libsystem_configuration.dylib (963.200.27) <94898525-ECC8-3CC9-B312-CBEAAC305E32> /usr/lib/system/libsystem_configuration.dylib
>     0x7fff6b811000 -     0x7fff6b814ff7  libsystem_coreservices.dylib (66) <10818C17-70E1-328E-A3E3-C3EB81AEC590> /usr/lib/system/libsystem_coreservices.dylib
>     0x7fff6b815000 -     0x7fff6b81bffb  libsystem_darwin.dylib (1272.200.26) <07468CF7-982F-37C4-83D0-D5E602A683AA> /usr/lib/system/libsystem_darwin.dylib
>     0x7fff6b81c000 -     0x7fff6b822ff7  libsystem_dnssd.dylib (878.240.1) <5FEA5E1E-E80F-3616-AD33-8E936D61F31A> /usr/lib/system/libsystem_dnssd.dylib
>     0x7fff6b823000 -     0x7fff6b86fff3  libsystem_info.dylib (517.200.9) <54B65F21-2E93-3579-9B72-6637A03245D9> /usr/lib/system/libsystem_info.dylib
>     0x7fff6b870000 -     0x7fff6b898ff7  libsystem_kernel.dylib (4903.241.1) <CA10BC3A-5B09-32CE-B74F-BAD01755AA37> /usr/lib/system/libsystem_kernel.dylib
>     0x7fff6b899000 -     0x7fff6b8e4ff7  libsystem_m.dylib (3158.200.7) <AF25F8E8-194C-314F-A2D3-A424853EE796> /usr/lib/system/libsystem_m.dylib
>     0x7fff6b8e5000 -     0x7fff6b909ff7  libsystem_malloc.dylib (166.220.1) <4777DC06-F9C6-356E-82AB-86A1C6D62F3A> /usr/lib/system/libsystem_malloc.dylib
>     0x7fff6b90a000 -     0x7fff6b915ff3  libsystem_networkextension.dylib (767.240.1) <4DB0D4A2-83E7-3638-AAA0-39CECD5C25F8> /usr/lib/system/libsystem_networkextension.dylib
>     0x7fff6b916000 -     0x7fff6b91dfff  libsystem_notify.dylib (172.200.21) <65B3061D-41D7-3485-B217-A861E05AD50B> /usr/lib/system/libsystem_notify.dylib
>     0x7fff6b91e000 -     0x7fff6b927fef  libsystem_platform.dylib (177.200.16) <83DED753-51EC-3B8C-A98D-883A5184086B> /usr/lib/system/libsystem_platform.dylib
>     0x7fff6b928000 -     0x7fff6b932fff  libsystem_pthread.dylib (330.230.1) <80CC5992-823E-327E-BB6E-9D4568B84161> /usr/lib/system/libsystem_pthread.dylib
>     0x7fff6b933000 -     0x7fff6b936ff7  libsystem_sandbox.dylib (851.230.3) <D6469A17-C13C-3538-A300-D6517BB7F249> /usr/lib/system/libsystem_sandbox.dylib
>     0x7fff6b937000 -     0x7fff6b939ff3  libsystem_secinit.dylib (30.220.1) <5964B6D2-19D4-3CF9-BDBC-4EB1D42348F1> /usr/lib/system/libsystem_secinit.dylib
>     0x7fff6b93a000 -     0x7fff6b941ff7  libsystem_symptoms.dylib (820.237.2) <487E1794-4C6E-3B1B-9C55-95B1A5FF9B90> /usr/lib/system/libsystem_symptoms.dylib
>     0x7fff6b942000 -     0x7fff6b957ff7  libsystem_trace.dylib (906.220.1) <4D4BA88A-FA32-379D-8860-33838723B35F> /usr/lib/system/libsystem_trace.dylib
>     0x7fff6b959000 -     0x7fff6b95effb  libunwind.dylib (35.4) <EF1A77FD-A86B-39F5-ABEA-6100AB23583A> /usr/lib/system/libunwind.dylib
>     0x7fff6b95f000 -     0x7fff6b98ffff  libxpc.dylib (1336.240.2) <EE0CDA53-6FF9-3B4E-A571-335A5FF6B6F4> /usr/lib/system/libxpc.dylib
> 
> External Modification Summary:
>   Calls made by other processes targeting this process:
>     task_for_pid: 0
>     thread_create: 0
>     thread_set_state: 0
>   Calls made by this process:
>     task_for_pid: 0
>     thread_create: 0
>     thread_set_state: 0
>   Calls made by all processes on this machine:
>     task_for_pid: 25582
>     thread_create: 0
>     thread_set_state: 0
> 
> VM Region Summary:
> ReadOnly portion of Libraries: Total=237.2M resident=0K(0%) swapped_out_or_unallocated=237.2M(100%)
> Writable regions: Total=35.5M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=35.5M(100%)
>  
>                                 VIRTUAL   REGION 
> REGION TYPE                        SIZE    COUNT (non-coalesced) 
> ===========                     =======  ======= 
> Kernel Alloc Once                    8K        2 
> MALLOC                            19.2M        9 
> MALLOC guard page                   16K        4 
> STACK GUARD                          4K        2 
> Stack                             16.0M        2 
> __DATA                            4244K       47 
> __LINKEDIT                       216.9M        5 
> __TEXT                            20.4M       45 
> __UNICODE                          564K        2 
> shared memory                        8K        3 
> ===========                     =======  ======= 
> TOTAL                            277.1M      111 
> 
> Model: MacBookPro15,1, BootROM 220.240.2.0.0 (iBridge: 16.16.3133.0.0,0), 6 processors, Intel Core i7, 2.2 GHz, 16 GB, SMC 
> Graphics: Intel UHD Graphics 630, Intel UHD Graphics 630, Built-In
> Graphics: Radeon Pro 555X, Radeon Pro 555X, PCIe
> Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix, -
> Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix, -
> AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x7BF), wl0: Sep 18 2018 16:24:57 version 9.130.86.7.32.6.21 FWID 01-83a3fe91
> Bluetooth: Version 6.0.10f1, 3 services, 27 devices, 1 incoming serial ports
> Network Service: Wi-Fi, AirPort, en0
> USB Device: USB 3.1 Bus
> USB Device: iBridge Bus
> USB Device: iBridge DFR brightness
> USB Device: iBridge Display
> USB Device: Apple Internal Keyboard / Trackpad
> USB Device: Headset
> USB Device: iBridge ALS
> USB Device: iBridge FaceTime HD Camera (Built-in)
> USB Device: iBridge
> Thunderbolt Bus: MacBook Pro, Apple Inc., 34.6
> Thunderbolt Bus: MacBook Pro, Apple Inc., 34.6
msg336904 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-03-01 08:49
How do you execute Python?
If you don't use terminal, please try executing Python from terminal.
And see what is output from Python in terminal.
msg336922 - (view) Author: (kellena) Date: 2019-03-01 14:58
When I run python3 in a terminal window, I get the same pop-up window with "Python quit unexpectedly error." In the terminal, I get:

Fatal Python error: initfsencoding: unable to load the file system codec

ModuleNotFoundError: No module named 'encodings'


Current thread 0x000000011422c5c0 (most recent call first):

Abort trap: 6
msg336925 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-03-01 15:31
> Fatal Python error: initfsencoding: unable to load the file system codec
>
> ModuleNotFoundError: No module named 'encodings'

OK, this is the important part which describes what Python failed.

In this case, Python can't find it's very important standard library; 'encodings'.

You may remove it, or you configured Python badly via environment variables.
Try `env | grep PYTHON` in your terminal.  Any environment variables
relating to Python is configured?
msg336949 - (view) Author: (kellena) Date: 2019-03-01 19:45
There isn't much. I downloaded this and installed it from python.org with the install wizard. Shouldn't all of the necessary environment variables have been added at that time?

$ env | grep PYTHON

PYTHONHOME=/usr/local/bin/python3
msg336953 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2019-03-01 20:31
Yes, the Mac installer should have installed everything, but software isn't perfect. :) I would try installing again.
msg336965 - (view) Author: (kellena) Date: 2019-03-01 22:57
Sounds good. Maybe I didn't uninstall properly. What is the correct way to uninstall Python 3.7 on a Mac? Should I also uninstall version 2.7, the version that came with the Mac? Installing version 3.7 did not over-write version 2.7.
msg336971 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2019-03-01 23:33
You must not set PYTHON HOME. Python find it's home by itself.
But since PYTHONHOME is set, Python can't find it's home.

2019年3月2日(土) 4:45 kellena <report@bugs.python.org>:

>
> kellena <onegreatbigworld@gmail.com> added the comment:
>
> There isn't much. I downloaded this and installed it from python.org with
> the install wizard. Shouldn't all of the necessary environment variables
> have been added at that time?
>
> $ env | grep PYTHON
>
> PYTHONHOME=/usr/local/bin/python3
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36154>
> _______________________________________
>
msg336982 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2019-03-02 03:52
Yes, remove the PYTHONHOME env variable definition and things should be fine.
msg336985 - (view) Author: (kellena) Date: 2019-03-02 04:09
That worked! Thank you!
History
Date User Action Args
2022-04-11 14:59:11adminsetgithub: 80335
2019-03-02 04:09:14kellenasetmessages: + msg336985
2019-03-02 03:52:12ned.deilysetstatus: open -> closed
resolution: works for me
messages: + msg336982

stage: resolved
2019-03-01 23:33:53methanesetmessages: + msg336971
2019-03-01 22:57:09kellenasetmessages: + msg336965
2019-03-01 20:31:45brett.cannonsetnosy: + brett.cannon, ned.deily, ronaldoussoren
messages: + msg336953
2019-03-01 19:45:39kellenasetmessages: + msg336949
2019-03-01 15:31:00methanesetmessages: + msg336925
2019-03-01 14:58:03kellenasetmessages: + msg336922
2019-03-01 08:49:21methanesetnosy: + methane
messages: + msg336904
2019-03-01 04:42:26kellenacreate