gpt4 book ai didi

python - 来自 google-cloud-sdk 的 Pylance 问题

转载 作者:行者123 更新时间:2023-12-05 04:46:56 25 4
gpt4 key购买 nike

Pylance 在我重新安装 Windows 后显示 Google Cloud SDK 错误。

from google.appengine.ext import ndb

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

第一期,由导入:

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

我需要为 Cloud SDK 添加 extraPaths。我已经看到/尝试过各种解决方案,发现这个很有效:

{ // 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"
]
}

当前问题,使用库的地方;整个代码。

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

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

我看不到前进的方向。

最佳答案

该项目运行 Python 2.7,而 Pylance 需要 3.0。

关于python - 来自 google-cloud-sdk 的 Pylance 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68679884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com