title: No module named 'matplotlib.pyplot'; 'matplotlib' is not a package
body: <p>Have found a <a href="https://stackoverflow.com/questions/32771559/importerror-no-module-named-matplotlib-with-matplotlib-installed">similar issue</a>, however haven't found proper solution.</p>
  
  <p>Here's a code: </p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.plot([1,2,3],[4,2,5])
  plt.show()
  </code></pre>
  
  <p>Run, got the message: </p>
  
  <blockquote>
    <p>ImportError: No module named 'matplotlib.pyplot'; 'matplotlib' is not a package</p>
  </blockquote>
  
  <p>I run Linux Mint 18 with preinstalled python-2.7 and python-3.5 (I use python3), before that I was installing modules with a simple <code>sudo apt-get install</code> method and that worked great. </p>
  
  <p>Before running this the code above, I've installed matplotlib in a usual way <code>sudo apt-get install python-matplotlib</code>. As it haven't worked out, started to look for solution.</p>
  
  <p><strong>Python location</strong></p>
  
  <p><code>which python3      /usr/bin/python3</code></p>
  
  <p><strong>Current Matplotlib installed</strong></p>
  
  <p><code>sudo find /usr | grep matplotlib    /usr/lib/python3/dist-packages/matplotlib</code></p>
  
  <p><strong>My tries:</strong> </p>
  
  <p>1) I've removed matplotlib with <code>autoremove</code>, and tried to make it <code>sudo apt-get install python3-matplotlib</code> instead. Didn't worked out.</p>
  
  <p>2) Used: <code>pip3 install matplotlib</code> or <code>sudo pip3 install matplotlib</code>. Received errors like: </p>
  
  <blockquote>
    <p>command python setup.py egg_info failed with error code 1 in /tmp/pip-build- ....</p>
  </blockquote>
  
  <p>3) Then I found another solution: </p>
  
  <pre><code>sudo apt-get install virtualenv
  virtualenv -p /usr/bin/python3 py3env
  source py3env/bin/activate
  pip install matplotlib
  </code></pre>
  
  <p>Same outcome.</p>
  
  <p>Haven't tried to use <code>import sys sys.path.append('/usr/lib/pymodules/python2.7/')</code>(proposed in link above), but as I am not sure what exactly this command does (quite a newbie to python and programming itself) - haven't risked.</p>