"UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm : <p>I am trying to plot a simple graph using pyplot, e.g.:</p>

<pre><code>import matplotlib.pyplot as plt
plt.plot([1,2,3],[5,7,4])
plt.show()
</code></pre>

<p>but the figure does not appear and I get the following message:</p>

<pre><code>UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
</code></pre>

<p>I saw in several places that one had to change the configuration of matplotlib using the following:</p>

<pre><code>import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
</code></pre>

<p>I did this, but then got an error message because it cannot find a module:</p>

<pre><code>ModuleNotFoundError: No module named 'tkinter'
</code></pre>

<p>Then, I tried to install "tkinter" using <code>pip install tkinter</code> (inside the virtual environment), but it does not find it:</p>

<pre><code>Collecting tkinter
  Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter
</code></pre>

<p>I should also mention that I am running all this on Pycharm Community Edition IDE using a virtual environment, and that my operating system is Linux/Ubuntu 18.04.</p>

<p><strong>I would like to know how I can solve this problem in order to be able to display the graph.</strong></p>
