title: Python (c)profile: Error importing SortKey from pstats
body: <p>I'm trying to work through the docs for Python's profile(rs). I'm using Python 3.6 in Anaconda on a Win10 laptop.</p>
  
  <p><a href="https://docs.python.org/3/library/profile.html" rel="noreferrer">https://docs.python.org/3/library/profile.html</a></p>
  
  <pre><code>import cProfile
  import re
  cProfile.run('re.compile("foo|bar")')
  </code></pre>
  
  <p>This executes no problem, per the docs.</p>
  
  <p>However,</p>
  
  <pre><code>import pstats
  from pstats import SortKey
  </code></pre>
  
  <p>results in this error message:</p>
  
  <pre><code>ImportError: cannot import name 'SortKey'
  </code></pre>
  
  <p>There is a <code>class SortKey(str, Enum)</code> in this version of <code>pstats</code>:
  <a href="https://github.com/python/cpython/blob/master/Lib/pstats.py" rel="noreferrer">https://github.com/python/cpython/blob/master/Lib/pstats.py</a></p>
  
  <p>However, when I look through local <code>pstats.py</code> files, I do not have that class, e.g. <code>~\AppData\Local\Continuum\anaconda3\envs\py36\Lib\pstats.py</code> is very different than the (cPython) <code>pstats.py</code>.</p>
  
  <p>I assume I am missing something obvious...</p>