Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spyder does not autocomplete local variables

I'm having a problem getting my local variables autocompleted. This is a very basic functionality which I'm sure it should support. When I'm starting to write a variable name which was already declared, and press TAB (this is the default shortcut), I get nothing. Is this a bug?

like image 304
idoda Avatar asked Aug 04 '13 15:08

idoda


People also ask

How do I turn on autocomplete on Spyder?

To do so, open Spyder's preferences, click on "Completion and linting" on the left hand side, and under the "Completion" tab, make the following changes: Ensure that "Enable code completion" is checked.

Does Spyder have intellisense?

(Spyder maintainer here) Unfortunately, Spyder can't provide code completion for all Python objects. This is not a failure in Spyder but a limitation in Python, due to its dynamic nature. Sorry.

How do I turn off Autocomplete on Spyder?

Use Tools >> Preferences >> Editor >> Advanced Settings >> Untick "Automatic insertion of parentheses, braces and brackets" Then Apply >> OK .

How do you integrate a Spyder kite?

To enable Kite in Spyder, go to Preferences/ Settings -> click on Completion and Linting -> click on the “Advanced” tab -> click “Enable Kite” under Providers -> click “Apply”.


1 Answers

(Spyder dev here) Spyder does complete local variables but to have this functionality you need to install a library called rope. You can do it by running this command in a terminal

pip install rope 

If you use Python 3 this command needs to be

pip install rope_py3k 

Besides, code completion on the Editor works now with both Ctrl+Space and with Tab.

Edit: Updated answer for the Spyder version 2.3.0.

like image 199
Carlos Cordoba Avatar answered Oct 05 '22 18:10

Carlos Cordoba