25

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 times 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?

2 Answers 2

76

You might try this at the top of your notebook:

%config Completer.use_jedi = False
5
  • The solution looks very strange, but it really solved the problem and stopped consuming a lot of my RAM and killing the kernel!
    – lucidyan
    Sep 16, 2017 at 14:34
  • 4
    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.
    – Zertrin
    Dec 18, 2017 at 4:19
  • 2
    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?
    – vkkodali
    Apr 5, 2019 at 17:38
  • 9
    @Kayvee You can add c.Completer.use_jedi = True to an ipython_config.py file. ipython.readthedocs.io/en/stable/development/config.html
    – Miles
    Apr 6, 2019 at 13:56
  • 1
    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?
    – rishi jain
    Jun 11, 2020 at 12:50
0

Jedi is the culprit. Either you can disable it as suggested by @Miles above,
or remove it completely.

pip uninstall jedi

Uninstallig worked for me. Jupyter suggestions are much faster now!

3
  • 2
    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
    – Ernest
    Aug 4, 2021 at 14:33
  • I did not face any issue. how did it mess up?
    – Vishal R
    Aug 4, 2021 at 15:03
  • It wouldn't load the kernel and show in terminal that it can't find jedi package.
    – Ernest
    Aug 9, 2021 at 11:14

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.