matplotlib not plotting in pycharm pro 2018.2


I have python 3.7 and pycharm pro 2018.2 running on Mac OSX (10.13.6). Everything is the latest and fully updated.

I create a new project, pure python, using system interpreter (/usr/local/bin/python3.7) or using venv (doesn't matter, the result is the same). Create a python file like this:

#!/usr/bin/env python3

import matplotlib.pyplot as plt
import numpy as np
import matplotlib

# Fixing random state for reproducibility

x = np.arange(0.0, 50.0, 2.0)
y = x ** 1.3 + np.random.rand(*x.shape) * 30.0
s = np.random.rand(*x.shape) * 800 + 500

plt.scatter(x, y, s, c="g", alpha=0.5, marker=r'$\clubsuit$',

Create a requirements.txt file with "matplotlib" in it, and install matplotlib.

Run the file (either run or debug in pycharm). It just starts and finishes instantly.

Go to a Terminal window and run it ./ and it works perfectly. (I had to chmod +x first). Displays the plot.

Why isn't this working in pycharm?


I have the same problem.  However it works perfectly on one PC and fails in the way indicated on another.  I can't find any configuration difference that would cause this.

Interestingly, when I run the app using the debugger or the profiler, the plot appears in the plot window.  When I run the app normally, the plot does not appear.



I am also having this problem. None of the suggestions on this site or StackOverflow work. Can anyone at Jet Brains look into this?


Hi Jmcanal,

May I ask you to attach a screenshot of your Run/Debug Configuration and upload your renamed idea.log (Help | Show Log in...) to and let me know the name of that file?

You could also use SUBMIT A REQUEST button on this page and attach it there, if you are worried about sensitive data.


Please sign in to leave a comment.