# Python launcher opens and immediately closes matplotlib.

**URL:** <https://mne.discourse.group/t/python-launcher-opens-and-immediately-closes-matplotlib/6066>\
**Category:** Support & Discussions\
**Tags:** eeg, visualization\
**Created:** [December 15, 2022, 1:12am UTC](https://mne.discourse.group/t/python-launcher-opens-and-immediately-closes-matplotlib/6066 "2022-12-15T01:12:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [December 15, 2022, 2:14pm UTC](https://mne.discourse.group/t/python-launcher-opens-and-immediately-closes-matplotlib/6066/2 "2022-12-15T14:14:38Z")

</div>

Hello and welcome to the forum!

I believe the following posting answers your question:

> [@Why does using a different IDE affect my raw.plot()?](https://mne.discourse.group/t/why-does-using-a-different-ide-affect-my-raw-plot/2770/2):
>
> Hello, The Python interpreter closes immediately after opening the plot window, because the end of your script is reached. You have two ways to work around this: Ensure execution is halted after plotting by passing block=True, i.e. raw.plot(block=True) Or edit your PyCharm run configuration such that your script is run in interactive mode (which might be something you want when working with data interactively anyway!) by ticking the “Run with Python Console” box. See [Create and edit run/debu…](https://www.jetbrains.com/help/pycharm/creating-and-editing-run-debug-configurations.html)

Best wishes,  
Richard

---

_[View the full topic](https://mne.discourse.group/t/python-launcher-opens-and-immediately-closes-matplotlib/6066)._
