<p dir="auto">After installing matplotlib I tried importing pyplot but got the error message below:</p>
<p dir="auto"><code class="notranslate">**RuntimeError**: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends.</code></p>
<p dir="auto">So I followed this solution: <a href="http://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python" rel="nofollow">http://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python</a></p>
<p dir="auto">However, now I'm getting this error</p>
<p dir="auto"><code class="notranslate">ImportError: No module named '_tkinter'</code></p>
<p dir="auto">Here is the entire stacktrace:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="▶ python
Python 3.5.0 (default, Sep 24 2015, 19:45:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import matplotlib.pyplot as plt
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/pyplot.py&quot;, line 114, in &lt;module&gt;
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/backends/__init__.py&quot;, line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/backends/backend_tkagg.py&quot;, line 6, in &lt;module&gt;
    from matplotlib.externals.six.moves import tkinter as Tk
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py&quot;, line 90, in __get__
    result = self._resolve()
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py&quot;, line 113, in _resolve
    return _import_module(self.mod)
  File &quot;/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py&quot;, line 80, in _import_module
    __import__(name)
  File &quot;/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py&quot;, line 35, in &lt;module&gt;
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'"><pre class="notranslate">▶ python
Python 3.5.0 (default, Sep 24 2015, 19:45:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type <span class="pl-s"><span class="pl-pds">"</span>help<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>copyright<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>credits<span class="pl-pds">"</span></span> or <span class="pl-s"><span class="pl-pds">"</span>license<span class="pl-pds">"</span></span> <span class="pl-k">for</span> more information.
&gt;&gt;&gt; import matplotlib.pyplot as plt
Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>&lt;stdin&gt;<span class="pl-pds">"</span></span>, line 1, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/pyplot.py<span class="pl-pds">"</span></span>, line 114, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = <span class="pl-en">pylab_setup</span>()
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/backends/__init__.py<span class="pl-pds">"</span></span>, line 32, <span class="pl-k">in</span> pylab_setup
    <span class="pl-en">globals(),locals</span>(),[backend_name],0)
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/backends/backend_tkagg.py<span class="pl-pds">"</span></span>, line 6, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    from matplotlib.externals.six.moves import tkinter as Tk
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py<span class="pl-pds">"</span></span>, line 90, <span class="pl-k">in</span> __get__
    result = <span class="pl-en">self._resolve</span>()
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py<span class="pl-pds">"</span></span>, line 113, <span class="pl-k">in</span> _resolve
    <span class="pl-k">return</span> _import_module(self.mod)
  File <span class="pl-s"><span class="pl-pds">"</span>/Users/bhaarat/.virtualenvs/cv3/lib/python3.5/site-packages/matplotlib-1.5.0rc1+83.g39f0136-py3.5-macosx-10.10-x86_64.egg/matplotlib/externals/six.py<span class="pl-pds">"</span></span>, line 80, <span class="pl-k">in</span> _import_module
    __import__(name)
  File <span class="pl-s"><span class="pl-pds">"</span>/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/tkinter/__init__.py<span class="pl-pds">"</span></span>, line 35, <span class="pl-k">in</span> <span class="pl-k">&lt;</span>module<span class="pl-k">&gt;</span>
    import _tkinter <span class="pl-c"><span class="pl-c">#</span> If this fails your Python may not be configured for Tk</span>
ImportError: No module named <span class="pl-s"><span class="pl-pds">'</span>_tkinter<span class="pl-pds">'</span></span></pre></div>
<p dir="auto">As reported on the mailing list thread "missing ticks in inverted log axis", it seems that the setup.py script favors the Framework Tcl/Tk when building the tkagg extension.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="elif sys.platform == 'darwin':
            # this config section lifted directly from Imaging - thanks to
            # the effbot!

            # First test for a MacOSX/darwin framework install
            from os.path import join, exists
            framework_dirs = [
                join(os.getenv('HOME'), '/Library/Frameworks'),
                '/Library/Frameworks',
                '/System/Library/Frameworks/',
            ]"><pre class="notranslate"><code class="notranslate">elif sys.platform == 'darwin':
            # this config section lifted directly from Imaging - thanks to
            # the effbot!

            # First test for a MacOSX/darwin framework install
            from os.path import join, exists
            framework_dirs = [
                join(os.getenv('HOME'), '/Library/Frameworks'),
                '/Library/Frameworks',
                '/System/Library/Frameworks/',
            ]
</code></pre></div>
<p dir="auto">I assume this was in here for a reason -- it's been like that for ages.  Do any Mac users have any thoughts/solutions?</p>
<p dir="auto">Cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pelson/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pelson">@pelson</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/r-owen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/r-owen">@r-owen</a></p>