Skip to content
Advertisement

Strange autocomplete suggestions in IPython Shell

I use the IPython shell fairly often and have just started to notice it giving me strange autocomplete suggestions without any prompting from me. In this example, I just typed “im” and it suggests importing matplotlib? enter image description here

This is very strange for several reasons: I’ve never seen this kind of grayed out code suggestion before that appears just as I type without the need to press tab or anything like that, the suggestions seem to be very arbitrary (why would typing im mean I want to import matplotlib of all things) and sometimes the suggestions make so sense (image 2: it just asks me to run plt.show() even though I haven’t plotted anything yet).

enter image description here

Any clues to what could be going on here?

Advertisement

Answer

Try this.

import IPython
terminal = IPython.get_ipython()
terminal.pt_app.auto_suggest = None

https://github.com/ipython/ipython/issues/13451

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement