I'm using jupyter notebook, and it works fine, but when I press TAB, the auto-completion doesn't work. I already checked all the similar cases in StackOverflow, but none of the solutions worked for me. I have also tried to do "pip upgrade" to: IPython, IPYKernel, Jedi, and Tornado, the upgrade works fine but the problem is still there. I tried in Firefox, Chrome and Edge. When I press TAB I can see those errors in the terminal:
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\ipykernel\kernelbase.py", line 265, in dispatch_shell
yield gen.maybe_future(handler(stream, idents, msg))
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\tornado\gen.py", line 234, in wrapper
yielded = ctx_run(next, result)
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\ipykernel\kernelbase.py", line 580, in complete_request
matches = yield gen.maybe_future(self.do_complete(code, cursor_pos))
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\ipykernel\ipkernel.py", line 356, in do_complete
return self._experimental_do_complete(code, cursor_pos)
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\ipykernel\ipkernel.py", line 381, in _experimental_do_complete
completions = list(_rectify_completions(code, raw_completions))
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\IPython\core\completer.py", line 484, in rectify_completions
completions = list(completions)
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\IPython\core\completer.py", line 1818, in completions
for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\IPython\core\completer.py", line 1861, in _completions
matched_text, matches, matches_origin, jedi_matches = self._complete(
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\IPython\core\completer.py", line 2029, in _complete
completions = self._jedi_matches(
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\IPython\core\completer.py", line 1373, in _jedi_matches
interpreter = jedi.Interpreter(
File "c:\users\tomer\appdata\local\programs\python\python39\lib\site-packages\jedi\api\__init__.py", line 725, in __init__
super().__init__(code, environment=environment,
TypeError: __init__() got an unexpected keyword argument 'column'
I'll be glad if someone can help me with this case
To enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options. Navigate to the one you want with the arrow keys, and hit Enter to choose the suggestion.
Latex and Unicode completion IPython and compatible frontends not only can complete your code, but can help you to input a wide range of characters. In particular we allow you to insert a unicode character using the tab completion mechanism.
Jupyter doesn't load or doesn't work in the browser Try disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.
Yes you have auto-complete built-in Jupyter, like you have in any other Jupyter environment. Simply hit the "Tab" key while writing code. This will open a menu with suggestions. Hit "Enter" to choose the suggestion.
The solution from @techno1731 is sub-optimal because it just disables jedi rather than fixing the underlying issue.
The latest jedi (0.18) release is incompatible with IPython 7.19 see this discussion. IPython: 7.20 (released Feb 1st 2020) and 8.0 (not yet released) have a compatibility fix.
The correct workaround at this time is to upgrade IPython:
pip install -U "ipython>=7.20"
In future you can search for the final two lines of the trackback after removing all path fragments specific to your installation, this is searching for:
super().__init__(code, environment=environment,
TypeError: __init__() got an unexpected keyword argument 'column'
This will give you the relevant issues on GitHub in the first two Google result as for today.
Note: this is a copy of my answer from Giant IPKernelApp Error Using Hydrogen in Atom question which indeed can appear unrelated given the Hydrogen/Atom setting. I will now vote to close all other questions on the topic as duplicate of this one.
I encontered the same issue some time ago with Jupyterlab when working locally on my machine with virtual environments.
This is a problem with Jedi being too slow (or rather taking forever) to load the completion, what worked for me was to add the follwing line at the top of the notebook (for example where you typically do the imports):
# Jedi not working
%config Completer.use_jedi = False
This should do the trick.
I'm using a previous version of jedi instead:
pip install jedi==0.17
that works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With