刚刚安装了关于我在 main.py 中的代码的扩展 ms-python.python Visual Studio 代码报告
Import "docopt" could not be resolved from source
{
"resource": "/home/XXXXXXXXX/main.py",
"owner": "_generated_diagnostic_collection_name_#0",
"code": {
"value": "reportMissingModuleSource",
"severity": 4,
"message": "Import \"docopt\" could not be resolved from source",
"source": "Pylance",
}
为什么我可以正常导入模块而 vscode 扩展ms-python.python不能?
如果我跑python
Python 3.9.6 (default, Jul 30 2021, 16:35:19)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more
information.
>>> import importlib
>>> docopt_spec = importlib.find_loader("docopt")
>>> found = docopt_spec is not None
>>> found
True