3

Pylance displays errors for Google Cloud SDK after I reinstalled Windows.

from google.appengine.ext import ndb

class Example(ndb.Model):
    basic_example = ndb.StringProperty()

The first issue, up by the import:

Import "google.appengine.ext" could not be resolved Pylance (reportMissingImports)

I needed to add extraPaths for Cloud SDK. I've seen/tried various solutions and found this effective:

{ // settings.json
  "python.analysis.extraPaths": [
    "C:/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine"
  ],
  "python.autoComplete.extraPaths": [
    "C:/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/platform/google_appengine"
  ]
}

Current issue, where the library is used; all over the code.

"Model" is not a known member of module Pylance (reportGeneralTypeIssues)

"StringProperty" is not a known member of module Pylance (reportGeneralTypeIssues)

I see no way forward.

Niklas Ternvall
  • 510
  • 1
  • 3
  • 19

1 Answers1

2

The project ran Python 2.7 while Pylance required 3.0.

Niklas Ternvall
  • 510
  • 1
  • 3
  • 19