【发布时间】:2021-02-27 10:44:19
【问题描述】:
我最近将我的操作系统升级到了 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
【问题讨论】:
-
你是如何安装这个版本的 Python 的?
/Users/USER/*/python似乎很可疑...... -
您能否提供一个导致崩溃的简短代码示例?它只在 PyCharm 中崩溃,还是在终端内运行时也会崩溃?如果您在此处收到错误消息,请提供。
-
例如。来自 matplotlib 的示例代码:
import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show()它显示 python 意外退出。我试过直接用它在终端中测试,它显示了同样的问题,以及一条消息zsh: segmentation fault python -
python.org在标题安装程序下说,“3.9.1 是第一个支持 macOS 11 Big Sur 的 Python 版本。现在可以使用 Xcode 11 及更高版本构建“Universal 2”适用于 Apple Silicon 的二进制文件。”