Jupyter中Completer与IPCompleter的差异解析、二者存在原因及Jedi配置问题答疑
Let’s break down this confusion clearly—it’s a common gotcha from IPython’s version transitions, so you’re not alone in scratching your head over it:
Core Differences
IPCompleter: This is the official, fully supported completion configuration class in IPython (the kernel that powers Jupyter Notebook). Every setting related to code completion—like
use_jedi,merge_completions, orgreedy—lives under this namespace. It’s the actual, active component handling all completion logic in modern IPython/Jupyter versions.Completer: This is a legacy alias for
IPCompleter, kept around solely for backward compatibility. It doesn’t exist as a real configuration class anymore, which is why you hit thatValueError: 'Completer' is not in listwhen trying to query it directly.
Why Does Setting Completer.use_jedi Work, But Querying It Doesn’t?
IPython’s config system has a hidden safety net: when you run %config Completer.use_jedi=False, the system automatically forwards that setting to IPCompleter.use_jedi under the hood. This is to avoid breaking old scripts, tutorials, or user configs written back when the component was still named Completer.
But when you try to check the value with %config Completer.use_jedi, the config system looks for a literal Completer class (which no longer exists) instead of using the alias mapping—hence the error. The correct way to check is always %config IPCompleter.use_jedi.
Why Does Jupyter/IPython Have Both?
Short answer: backward compatibility.
In older IPython versions (pre-5.x, roughly), the completion component was indeed named Completer. When the team renamed it to IPCompleter (to make it clearer that this is IPython’s custom completer, not a generic one), they added the alias mapping to ensure existing code wouldn’t break overnight. Over time, they’ve phased out direct support for the Completer alias for queries, to encourage users to migrate to the official IPCompleter name.
So to recap:
- Use
%config IPCompleter.use_jedito check the current Jedi completion state - Use either
%config IPCompleter.use_jedi=Falseor the legacy%config Completer.use_jedi=Falseto disable Jedi (though the former is preferred for modern code)
内容的提问来源于stack exchange,提问作者robertspierre

