[{
"resource": "/d:/Users/Home/Desktop/Python/estudos/pratices.py",
"owner": "_generated_diagnostic_collection_name_#0",
"code": {
"value": "reportMissingModuleSource",
"target": {
"$mid": 1,
"external": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportMissingModuleSource",
"path": "/microsoft/pyright/blob/main/docs/configuration.md",
"scheme": "https",
"authority": "github.com",
"fragment": "reportMissingModuleSource"
}
},
"severity": 4,
"message": "Import \"pandas\" could not be resolved from source",
"source": "Pylance",
"startLineNumber": 1,
"startColumn": 8,
"endLineNumber": 1,
"endColumn": 14
}]
是给出的消息 cmd shell 告诉我我已经安装了所有我想要安装的库,它们位于项目文件夹中,我正在运行虚拟环境,但是每当我尝试在 .py 文件中运行某些内容时,它都会说它未定义,我已经安装了 anaconda 但现在不想使用它,如果我打开一个 jupyter 文件,导入没有问题,但尝试运行 pip 根本不起作用
重新安装 vscode,确保安装了 python,确保安装了 pip
我之前也遇到过类似的问题,我找到的解决方案是,你必须确保当前 VSC 窗口的 python 解释器是你的虚拟环境,而不是系统范围的 python 解释器。在 Windows 上:
我在 vscode 上导入了 python 项目,但它在终端上买了这个错误,我该怎么办,
$ :术语“$”不被识别为 cmdlet、函数、脚本文件或可操作程序的名称。检查名称的拼写,或者路径是否正确 已包含,请验证路径是否正确,然后重试。 在行:1 字符:1