Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pylance issues from google-cloud-sdk

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.

like image 719
Niklas Ternvall Avatar asked Jul 04 '26 10:07

Niklas Ternvall


1 Answers

The project ran Python 2.7 while Pylance required 3.0.

like image 110
Niklas Ternvall Avatar answered Jul 07 '26 07:07

Niklas Ternvall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!