"Name Error: name 'get_ipython' is not defined" while preparing a debugging session via "import ipdb"
<p>I'm trying to install and use ipdb (IPython-enabled pdb) on Python 3.3.5 32 bit on Win10 using PIP 8.1.2.
I've installed via PIP (had to install it seprately) in windows cmd with no errors:</p>

<pre><code> pip install ipdb
</code></pre>

<p>I wrote a simple test script expecting to stop in debugger before printing 'test' string, <em>ipdb_test.py</em>:</p>

<pre><code>import ipdb
ipdb.set_trace()
print('test')
</code></pre>

<p>When running it from IDLE editor the following exceptions show up:</p>

<pre><code>Traceback (most recent call last):
  File "C:\Python33.5-32\lib\site-packages\ipdb\__main__.py", line 44, in &lt;module&gt;
    get_ipython
NameError: name 'get_ipython' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/temp/ipdb_test.py", line 1, in &lt;module&gt;
    import ipdb
  File "C:\Python33.5-32\lib\site-packages\ipdb\__init__.py", line 7, in &lt;module&gt;
    from ipdb.__main__ import set_trace, post_mortem, pm, run             # noqa
  File "C:\Python33.5-32\lib\site-packages\ipdb\__main__.py", line 51, in &lt;module&gt;

  (...)

  File "C:\Python33.5-32\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 266, in flush
    self.stdout.flush()
AttributeError: 'NoneType' object has no attribute 'flush'
</code></pre>

<p>As the issue seemed to be related to IPython, I've checked that the version installed while resolving ipdb dependencies was: "ipython-5.1.0". </p>

<p>The WA solution for the issue occured to be a fallback to version 4.2.1 of IPython:</p>

<pre><code>pip install "ipython&lt;5"
    (...)
    Successfully uninstalled ipython-5.1.0
    Successfully installed ipython-4.2.1
</code></pre>

<p>After that ipdb halted on a breakpoint as expected:</p>

<pre><code>$ python C:\temp\ipdb_test.py
WARNING: Readline services not available or not loaded.
WARNING: Proper color support under MS Windows requires the pyreadline library.
You can find it at:
http://ipython.org/pyreadline.html

Defaulting color scheme to 'NoColor'
&gt; c:\temp\ipdb_test.py(3)&lt;module&gt;()
      1 import ipdb
      2 ipdb.set_trace()
----&gt; 3 print('test')

ipdb&gt;
</code></pre>

<p>It may be a valid case to contact the IPython project team on the issue, meanwhile I find an initial task of running a debug session completed.</p>

python python-3.x ipython ipdb