[Solved] Django backend error: Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay()

Complete error

Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay() != currentlyBuildingLayerTree), function NSViewSetCurrentlyBuildingLayerTreeForDisplay

Solution

Because matplotlib is used in the backend, Add the following codes in the drawing code:

import matplotlib
matplotlib.use('Agg')

Then use the following code after the drawing is over:

plt.close()

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *