title: How to fix "object has no attribute" error when importing matplotlib.pyplot
body: <p>I'm recently trying to do something with Tensorflow. The installation seems very fine until I've encountered this problem. When importing matplotlib.pyplot, AttributeError was thrown. Below is the detail:</p>
  
  <pre><code>&gt;&gt;&gt; import matplotlib.pyplot
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/home/syine/venv/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2349, in &lt;module&gt;
      switch_backend(rcParams["backend"])
    File "/home/syine/venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 820, in __getitem__
      plt.switch_backend(rcsetup._auto_backend_sentinel)
    File "/home/syine/venv/lib/python3.7/site-packages/matplotlib/pyplot.py", line 212, in switch_backend
      newbackend[9:] if newbackend.startswith("module://")
  AttributeError: 'object' object has no attribute 'startswith'
  
  </code></pre>
  
  <p>Seemingly it's an internal error in the module, however I can't find any hint to solve the issue.</p>
  
  <p>I tried reinstalling matplotlib and all of its dependencies (FreeType, libpng, NumPy, setuptools, cycler, dateutil, kiwisolver, pyparsing), but none of them could solve the problem.</p>