Python退出MacOS Big Sur

2022-05-21 08:04:31 发布

您现在位置:Python中文网/ 问答频道 /正文

最近我将我的操作系统升级到MacOS Big Sur,Pycharm无法与我的代码一起运行。错误消息表示python在当前操作系统中意外退出。matplotlib等函数会触发此问题

Problem details and system configuration

Process:               python3.7 [2347]
Path:                  /Users/USER/*/python
Identifier:            python3.7
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        pycharm [814]
Responsible:           pycharm [814]
User ID:               504

Date/Time:             2020-11-16 15:37:02.559 +0800
OS Version:            macOS 11.0.1 (20B29)
Report Version:        12
Anonymous UUID:        34EA0CE8-BDD4-CCC6-1DBE-DE5330A5B79D


Time Awake Since Boot: 2000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0xffffffff00000008
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [2347]

VM Regions Near 0xffffffff00000008:
--> unused shlib __TEXT      7fffde96f000-7fffe1cf3000 [ 51.5M] r--/r-- SM=COW  system shared lib __TEXT not used by this process
    

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   python                          0x0000000103101293 PyBuffer_Release + 19
1   com.apple.CoreGraphics          0x00007fff24f74a8d data_release_info + 31
2   com.apple.CoreGraphics          0x00007fff24f25f81 data_provider_finalize + 64
3   com.apple.CoreGraphics          0x00007fff24eebf8d data_provider_retain_count + 74
4   com.apple.CoreFoundation        0x00007fff204dadd8 _CFRelease + 474
5   com.apple.CoreGraphics          0x00007fff24f51cff image_finalize + 103
6   com.apple.CoreFoundation        0x00007fff204dacf2 _CFRelease + 244

Tags: comappledatatimeversiontypeexceptioncodeprocesssystemthreadpycharmcoregraphicsdispatchcrashed
3条回答
网友
1楼 ·

在Big Sur升级后,我遇到了完全相同的问题。它在Python3.6中保持不变 我找到了一个临时解决方法,将plt.show()行替换为plt.savefig(“文件名”)。当然,这是一种使用舒适性的丧失

现在,通过从Python3.6转换到3.9,完全解决了这个问题

网友
2楼 ·

这似乎是一个版本问题。我将它转换为Python3.6,问题就解决了。也许python 3.7和更高版本不能支持这些LIB

网友
3楼 ·

我在python2.7.16中遇到了类似的问题,我尝试将matplotlib版本降级到1.5.3,然后解决了问题

pip install  user matplotlib==1.5.3

也许也可以试试Python3的较低版本