Post

Disabling IPython AutoComplete

I use IPython quite often to validate my code and ensure that it is going to work the way I intended. There is something I don’t like from IPython though and that is its autocomplete feature.

Most of the time, it tries to autocomplete what I am writing with code that I do not need. See the next screenshot

I just learned this feature can be disabled, so not only I am doing that but also documenting how to do it for future references.

On Windows

On a Terminal or Command Prompt

1
ipython profile create
output
1
2
3
4
5
6
7
8
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\user> ipython profile create
[ProfileCreate] Generating default config file: WindowsPath('C:/Users/user/.ipython/profile_default/ipython_config.py')
PS C:\Users\user>


Now, open the file with a text edit. Notepad would work just fine

1
notepad.exe <FILE>
output
1
2
PS C:\Users\user> notepad.exe C:/Users/user/.ipython/profile_default/ipython_config.py
PS C:\Users\user>


Ensure the following configuration lines are in the file

1
2
c = get_config()
c.TerminalInteractiveShell.autosuggestions_provider = None

Example:

The next time IPython is opened, autocomplete will be disabled

On Mac OS X and Linux

The process is quite similar on Mac OS X and Linux. If the file is not there yet, create it in the following path using the text edit of your preference (I use Vim)

1
~/.ipython/profile_default/ipython_config.py

The file should contain the following configuration lines which are actually the same ones than in Windows.

1
2
c = get_config()
c.TerminalInteractiveShell.autosuggestions_provider = None

Done, next time IPython is opened, autocomplete will be disabled

References

This post is licensed under CC BY 4.0 by the author.