Kernel taking too long to autocomplete (tab) in Jupyter notebook

11,103

Little late answer, but you might try this at the top of your notebook:
%config Completer.use_jedi = False

Share:
11,103

Related videos on Youtube

Patthebug
Author by

Patthebug

Updated on June 04, 2022

Comments

  • Patthebug
    Patthebug almost 2 years

    I just installed a few libraries for Deep Learning like keras, theano etc. The installation went fine but when I write code in Jupyter notebook and press tab for autocompletion, the kernel of jupyter notebook seems to take too long for autocompletion. There have been time when it has taken minutes to display autocompleted options. I initially thought that the kernel hung so I had to restart it every time.

    I read in another Stack Overflow post that installing pyreadline may help. I installed it but I'm still having the same problem.

    Has anyone else faced this problem? How do I go about fixing this?

    Any pointers would be greatly appreciated.

  • lucidyan
    lucidyan over 6 years
    The solution looks very strange, but it really solved the problem and stopped consuming a lot of my RAM and killing the kernel!
  • Zertrin
    Zertrin over 6 years
    To get a bit more context on this solution, refer to github.com/ipython/ipython/issues/10493 and github.com/davidhalter/jedi/issues/931 where this solution is discussed.
  • vkkodali
    vkkodali about 5 years
    Is there a way to put this in some config file so that I don't have to add this to every single notebook I create?
  • Miles
    Miles about 5 years
    @Kayvee You can add c.Completer.use_jedi = True to an ipython_config.py file. ipython.readthedocs.io/en/stable/development/config.html
  • rishi jain
    rishi jain almost 4 years
    it doesn't work for me - Name of pandas dataframes take lot of time for auto complete.. dont know the reason. Any ideas how to debug?
  • Ernest
    Ernest over 2 years
    Don't do this. It messed up my Jupyter notebook kernels. Use either inline %config Completer.use_jedi = False or set c.Completer.use_jedi = True in ipython_config.py
  • Vishal R
    Vishal R over 2 years
    I did not face any issue. how did it mess up?
  • Ernest
    Ernest over 2 years
    It wouldn't load the kernel and show in terminal that it can't find jedi package.