title: How to Install Matplotlib for Python 3.9 in Windows?
body: <p>I cannot seem to figure out how to install Matplotlib for Python 3.9 on Windows. These are the commands I have entered into Command Prompt and none of them have worked.</p>
  <pre><code>$ python -m pip install --user matplotlib
  
  $ python3 -m pip install --user matplotlib
  
  python3 -m pip install matplotlib --pre --user
  
  py -m pip install -U matplotlib --user
  </code></pre>
  <p>The first two give this error message:</p>
  <pre><code>'$' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  <p>The second gives this error message:</p>
  <pre><code>Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings &gt; Manage App Execution Aliases.
  </code></pre>
  <p>The third seemed to have downloaded everything, but when I try to run Matplotlib in Python, it gives me this error message:</p>
  <pre><code>    Traceback (most recent call last):
    File &quot;C:\Users\costr\AppData\Local\Programs\Python\Python39\temporary.py&quot;, line 1, in &lt;module&gt;
      import matplotlib.pyplot as plt
  ModuleNotFoundError: No module named 'matplotlib'
  </code></pre>
  <p>Here is the code I am trying to run:</p>
  <pre><code>import matplotlib.pyplot as plt
  
  squares=[1, 4, 9, 16, 25]
  
  fig, ax=plt.subplots()
  ax.plot(squares)
  
  plt.show()
  </code></pre>