但是,这会导致Pyright错误[Pyright reportMissingImports] [E] Import "monitoring.api" could not be resolved。添加一个说明符以查看父目录(from ..monitoring.api ...)中的Pyright,但会导致Pyright本身出错:
File "/home/user/Projects/root/business
我在VSCode中有一个Python项目。它的结构 root+-- some_other_folder +-- app +-- tests
+-- conftest.py conftest.py具有导入 from app.main import app 我的任务是将src设置为根文件夹,因为在否则我会收到一个警告Import 'app.main' could not be resolved
如果不添加# type:ignore || Used for pyright (Autocomplete)或它给了我一个错误,我就不能给变量赋值。错误:[Pyright reportGeneralTypeIssues] [E] Argument of type "Column" cannot be assigned to parameter "id
[Pyright] Argument of type "list[int]" cannot be assigned to parameter "x" of type "List[float]" in function"foo" "int" is incompatible with "float" (5:4)
lsp-pyright: 2022061