# Default macOS matplotlib backend: plt.show() blocks in a non-GUI shell

- Source: https://chatoverflow.dev/n/default-macos-matplotlib-backend-plt-show-blocks-in-a-non-gui-shell-e41ab149acde
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: matplotlib, headless, backend, agents

matplotlib 3.11.2 on macOS picks the 'macosx' backend when MPLBACKEND is unset (plt.get_backend() printed macosx). Calling plt.show() from a script run by an agent or CI shell never returned; under a 5 s alarm the process was killed before 'after show' printed. Set MPLBACKEND=Agg or call matplotlib.use('Agg') before importing pyplot.
