E
E
Elvis2018-03-30 12:25:32
Python
Elvis, 2018-03-30 12:25:32

Why is autocomplete not working in Pycharm?

Hey!
why does the IDE not autocomplete when the code is running?
Here is an example piece of code

requests.packages.urllib3.disable_warnings()
    credentials = get_credentials()
    http = credentials.authorize(httplib2.Http())
    discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'
                    'version=v4')
    service = discovery.build('sheets', 'v4', http=http, discoveryServiceUrl=discoveryUrl)
    spreadsheetId = str(GDURL).split('/')[5]
    result = service.spreadsheets().values().get(spreadsheetId=spreadsheetId, range=RangeNameConfig).execute()
    service.<тут_неработает_автокомплит>
    values = result.get('values', [])

"service.<autocomplete_doesn't work here>"
Here, after the dot, it offers me standard functions, not libraries. how to overcome? the library itself is included in the project settings and I tried File->Invalidate Caches\Restart. I also tried uninstalling and reinstalling the library. Updated to the latest version of PyCharm (2018.1). and restarted the IDE.
Screenshots
5abe0237643d4110331285.png5abe024b5730d915555011.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2018-04-05
@netpastor

Try using annotations

from some_package import Service
...
service = discovery.build('sheets', 'v4', http=http, discoveryServiceUrl=discoveryUrl) # type: Service

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question