Supporting matplotlib for both python 2 and python 3 on Mac OS X
<p>We're building code that we want to run on both Python 2 &amp; 3. It uses matplotlib. My local machine runs OS X Yosemite. </p>

<p>The <a href="http://matplotlib.org/faq/installing_faq.html#os-x-notes" rel="nofollow">matplotlib installation documentation</a> provides instructions for both python 2 &amp; 3, but implies that both cannot be supported on a single Mac. Is this true, and if not how can both be supported with matplotlib?</p>

<p>(Parenthetically, I know that separate installations can be made with virtual environments or machines. However, I've found these cumbersome on Macs. On the other hand, I'm also testing builds on a commercial cloud-based build tester that uses separate VMs for each configuration, which works reasonably well.)</p>

<p>This appears to work:</p>

<blockquote>
  <p>python 3: install <a href="https://www.python.org/ftp/python/3.5.2/python-3.5.2-macosx10.6.pkg" rel="nofollow">https://www.python.org/ftp/python/3.5.2/python-3.5.2-macosx10.6.pkg</a></p>
</blockquote>

<pre><code>curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
pip3 install nose
pip3 install matplotlib
pip3 install cobra
pip3 install numpy
pip3 install scipy
pip3 install openpyxl
pip3 install future
pip3 install recordtype
pip3 install lxml
pip3 install python-libsbml
</code></pre>

<blockquote>
  <p>python 2: install <a href="https://www.python.org/ftp/python/2.7.12/python-2.7.12-macosx10.6.pkg" rel="nofollow">https://www.python.org/ftp/python/2.7.12/python-2.7.12-macosx10.6.pkg</a></p>
</blockquote>

<pre><code>curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
sudo pip2 install nose
sudo pip2 install matplotlib
sudo pip2 install cobra
sudo pip2 install numpy
sudo pip2 install scipy
sudo pip2 install openpyxl
sudo pip2 install future
sudo pip2 install recordtype
sudo pip2 install lxml
sudo pip2 install python-libsbml
sudo pip2 uninstall python-dateutil        # deal with bug in six; see http://stackoverflow.com/a/27634264/509882
sudo pip2 install python-dateutil==2.2
</code></pre>

python osx matplotlib