Spyder 5.0.1 Kite Autocompletion Issues Including Latency

1,846 views
Skip to first unread message

Philip Yip

unread,
Apr 30, 2021, 8:04:29 AM4/30/21
to spyder
I have been using both JupyterLab 3.0.14 and Spyder 5.0.1 and I noticed that the experience with Spyder 5.0.1 is a bit frustrating mainly because of the code auto-completion. This may be more of a Kite than a Spyder issue...

In JupyterLab, the code completion does not automatically display but will display when tab is pressed. For example if I import numpy as np and type in:

np.↹

I get a list of all the statements/functions/classes I can pull from the numpy library.

1 jupyterlab.png

Then if I type in a function or class and press shift and tab I get details about the input arguments. e.g.

np.array⇧↹

2 jupyterlab.png

This works pretty well for numpy, matplotlib, pandas...

3 jupyterlab.png

Moving onto Spyder 5.0.1 with Kite...

If I import numpy as np and then type np. in the script nothing displays.

4 spyder.png

I need to run the script with the solo command import numpy as np before using any autocompletion in the script with numpy (partially) works.

5 spyder.png

After about a minute latency the following displays... 

6 spyder.png

kite.PNG

I can then select from the list the class or function that I want:

7 spyder.png

Next Spyder has both the Script Editor and the Console. If I now go to the Console and type in np. nothing happens. If I type in np.↹ then the following autocompletion shows. I think this is Jedi opposed to Kite...

9 spyder.png

Now if I type in a class/function with open parenthesis. This seems to work with Kite both in the script editor and console.

10 spyder.png

The performance is slightly better for matplotlib. There is about a 30 s delay with plt. opposed to about 60 s with np. Either way the delay is still too long hindering productivity.

11 spyder.png

However once again typing plt. into the console does not generate a Kite autocompletion.

12 spyder.png

Typing in plt.↹ generates a Jedi autocompletion.

13 spyder.png


If I type in "import numpy as np" as an earlier line in the script. Should np. not generate autocompletion both later on in the script and in the console using Kite without the latency issue (without previously running the script).

Also can the behaviour of Kite be changed so it doesn't pop up automatically and only pops up (no delay) if requested? i.e. uses the same shift and tab shift keyboard combination as JupyterLab.
np.↹
np.array⇧↹ 
i.e. exhibits similar behaviour (to Jedi) and the code competition in JupyterLab.
Alternatively, if that is not possible to do with Kite is there a way to use the code completion from JupyterLab within Spyder instead of Kite?








yfprojects

unread,
May 1, 2021, 5:49:58 AM5/1/21
to spyder
Hi,
the ipython console/ qtconsole never uses Kite. As far as I know Kite only supplies extra completions. The display of the doc strings and the method/function signature is provided by another linting tool - probably jedi. The whole linting and completion functionality is bundled in a python language server (pyls). The server should provide completion options along with kite's completion. If kite is too slow on your PC, try to disable it.

Kind regards,
yfprojects

Philip Yip

unread,
May 2, 2021, 3:05:18 PM5/2/21
to spyder
It is still extremely slow without Kite installed. I guess it is related to this issue de to be resolved in Spyder 5.0.3.

Completions extremely slow · Issue #15042 · spyder-ide/spyder · GitHub

Vincent gope

unread,
Jun 15, 2021, 11:54:58 AM6/15/21
to spyder
Hey, I had the same latency problem and found a way to solve it. For information, I use Spyder 5.0.0.

1) Open Kite.
2) Click on the parameter button in the bottom right corner.

googlehelp1.png


3) Go to Plugins.

googlehelp2.png

4) Within the category "AVAILABLE EDITOR PLUGINS", install the Spyder IDE one.


googlehelp3.png

I did this and autocompletion worked again.

I hope this will help you.

Best regards.

Philip Yip

unread,
Jun 16, 2021, 2:31:46 PM6/16/21
to spyder
Hi Vicent

Thanks.
I just upgraded my Anaconda installation to 5.0.4 using:

conda install --channel conda-forge spyder=5.0.4

Then I tried carrying out your fix. 

It has helped slightly, now it takes about 5 seconds for:
np.
to show the autocompletion list opposed to about 30 s.


The line

import numpy a

Now autocompletes to:

import numpy as np

62a.png

But

np.

still takes about 5 s to display. An improvement of the 30 s lag from before but still slower than it should.
62a2.png

In comparison:

import datetime as dt
dt.

is pretty much instant:

64.png

Kite gives the most commonly used methods/attributes at the top followed by everything else ordered alphabetically.
I've noticed from time to time, Kites most commonly used recommendations are a bit ropey in general.

However for a numpy array in particular it is not exactly giving correct recommendations for an array instance.
In the below, x is a numpy array instance. 

In this case it gives str methods which do not apply to the object x:
62.png

The list of methods/attributes below this are the correct ones belonging to the array:

63.png

Seems there is some confusion to its recommendations.



Impossible But true

unread,
Jun 23, 2021, 5:22:05 PM6/23/21
to spyder
hi,

I had the same latency problem when using kite, when I type import datetime as dt : it's pretty much instant, but when I type dt.  I have to wait around 15 s before it shows results, idk if it's because of my computer or it's a common issue. 
Reply all
Reply to author
Forward
0 new messages