问题标签 [pylance]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 为什么我不能在 VS Code 中导入请求?
我想使用请求模块,但是每当我尝试导入请求时,我都会收到以下消息:
我已经使用 pip 安装了 requests 模块,但我仍然收到此错误消息。
python - Pylance 正在从 BeautifulSoup 的 find_all -> ResultSet 中检测 PageElement 而不是 Tag
这是一段代码:
问题是,当我检查 的类型时soup_possible_form
,Pylance 显示它是一个PageElement
不正确的对象,它应该是一个Tag
对象,因此name = soup_possible_form.get('name')
被标记为错误,因为根据 Pylance 消息:
无法访问类型“PageElement”的成员“get”
成员“get”未知Pylance (reportGeneralTypeIssues)
我正在做一个我大量使用 BeautifulSoup 的项目,我不想# type: ignore
在每次find_all -> ResultSet
迭代中都使用它。
python - 如何修复“x”未访问 Pylance
它说“x”没有被访问 Pylance 但我不知道为什么它曾经工作到现在。如果可以请帮忙。
python - VS/Pylance 警告:无法解析导入“模块”
嗨,我收到以下警告(导入下方的波浪线)import "numpy" could not be resolved Pylance(reportMissingModuleSource)
,。执行代码没有问题 - 工作正常,只是警告(波浪线)。
在以下 github 页面中,它声明使用以下行更改 Settings.JSON "python.analysis.extraPaths": ["./sources"]
。
- https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#unresolved-import-warnings
然而这并没有奏效。我还尝试将路径添加到当前目录,然后添加“源”,如图所示。但它也没有工作。
/home/imantha/workspace/python
我正在使用bash
withcode .
命令从这个入口点打开 vs 代码。
谁能知道我如何添加正确的路径。
python - pylance 未显示所有可用模块
在我使用 pylance 的 vs 代码中,当我键入 pygame 时,自动完成不会显示包示例中的所有模块。jedi 将在自动完成中显示显示模块,但在 pylance 中不会。我尝试更新 vscode、pylance 并搜索了谷歌,但我找不到解决方案,谁能告诉我问题是什么?
python - Visual Studio Code pylance 搜索文件夹
我有一个项目,里面有一些 python - python 是一个更大的东西的一部分 - 在根 git 的几个目录中有几个程序 - 在另一个目录中有一些通用代码。
运行正常 - 但 Visual Studio 代码中的 pylance 将所有依赖项视为错误,即使大多数依赖项位于我正在编辑的脚本的当前目录中。如果我打开该子目录,它们可以正常工作-但我真的希望在更大的项目级别上打开可视代码。
有什么方法可以在目录中的某处插入一个文件,告诉 pylance“这里是 python 搜索路径”之类的?
python - 我可以在 Pylance 中禁用第三方包的类型错误吗?
我使用的一些包没有键入提示它们的代码,所以当我使用它们时,Pylance 一直告诉我我使用的函数有部分未知类型,这是我无法解决的问题。有没有办法禁用此类错误?
pandas - Visual Studio doesn't show help pop up with DataFrame from awswrangler
I am using VS Code with Microsoft Python extension. If I create a Pandas dataframe and write the name of the variable VS Code popups all kinds of help text. However, if I have a variable made using wr.athena.read_sql_query, I don't get any help text even if the variable is a Pandas dataframe.
Is there a way to make VS Code realize that df2 in the example is a Pandas DataFrame and get the help text?
python - 导入“flask_mysqldb”无法解析 Pylance(reportMissingImports)
呃,我得到这个错误
导入“flask_mysqldb”无法解析 Pylance(reportMissingImports)
而且我真的不知道我是否遗漏了一些东西,因为当我尝试安装东西时,它说“要求已经满足”,我很恐慌,因为我不知道自己做错了什么。这是我正在使用的实际代码,但我不能使用与数据库相关的任何内容,因为第二行不起作用:
from flask import Flask, render_template, request, redirect, url_for, flash
from flask_mysqldb import MySQL