简体   繁体   English

分段错误:升级到 OS Big Sur 后出现 11 python

[英]Segmentation fault: 11 python after upgrading to OS Big Sur

Yesterday, my program was working perfectly fine.昨天,我的程序运行良好。 However, today it stopped working.但是,今天它停止工作。 I think that it may have something to do with the latest Mac OS update, as I had just installed it today.我认为它可能与最新的 Mac OS 更新有关,因为我今天刚刚安装了它。 My testing code is shown below我的测试代码如下所示

import matplotlib.pyplot as plt
import numpy as np
print("ehllow")
zeroes = np.zeros((10,10))
plt.imshow(zeroes)
plt.show()

Everything is going fine until I get to plt.show().一切顺利,直到我到达 plt.show()。 I had tried removing it, and the program ran smoothly, but once I added it back in I got the error我曾尝试删除它,并且程序运行顺利,但是一旦我将其添加回来,我就收到了错误

Segmentation fault: 11分段错误:11

and then it shows a python crash screen然后它显示一个python崩溃屏幕在此处输入图片说明

I have python version 3.7.6 64 bit for Mac.我有适用于 Mac 的 3.7.6 64 位 python 版本。

Ok.好的。 Just for anyone wondering只为任何想知道的人

Just uninstalling and reinstalling the packages that were giving the error worked for me只需卸载并重新安装出现错误的软件包对我有用

pip uninstall matplotlib
pip install matplotlib

I had the same issue - a Python program that was working fine before updating to Big Sur, and crashing with:我遇到了同样的问题 - 一个 Python 程序在更新到 Big Sur 之前运行良好,并且崩溃了:

Segmentation fault: 11

after updating.更新后。

As previous responses have advised, just uninstalling and reinstalling the offending Python libraries fixed the problem.正如之前的回复所建议的,只需卸载并重新安装有问题的 Python 库即可解决问题。 For me, that meant matplotlib:对我来说,这意味着 matplotlib:

pip uninstall matplotlib 
pip install matplotlib 

Thank you!谢谢!

您是否尝试过卸载它并重新安装最新的 python 更新并重新启动您的 PC/笔记本电脑?

I also had the same issue: Segmentation fault: 11我也有同样的问题:分段错误:11

I guess, it is because of the statement line: plt.show()我想,这是因为语句行: plt.show()

As stated above, uninstallation and reinstallation of matplotlib worked for me.如上所述,matplotlib 的卸载和重新安装对我有用。 Thank you!谢谢!

Reinstalling is the best option but you can also use:重新安装是最好的选择,但您也可以使用:

import matplotlib as mpl
mpl.use('MacOSX')
import numpy as np
import matplotlib.pyplot as plt

i had to drop my dpi from 400 to 50 on the OSX machine.我不得不将 OSX 机器上的 dpi 从 400 降低到 50。 none of these other approaches worked.这些其他方法都不起作用。 fwiw, my update was to Catalina, not Big Sur. fwiw,我的更新是到 Catalina,而不是 Big Sur。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM