Closed Molkree closed 2 years ago
Type stub created successfully, probably only for imported interfaces but the whole module would be fine as well.
An error occurred when creating type stub for 'defusedxml.ElementTree': Import 'defusedxml.ElementTree' could not be resolved
[Info - 12:13:19 am] No configuration file found. [Info - 12:13:19 am] No pyproject.toml file found. [Info - 12:13:19 am] Setting pythonPath for service "cloned service": "c:\Users\mrmol\Downloads\LeetCode\.venv\Scripts\python.exe" [Warn - 12:13:19 am] stubPath c:\Users\mrmol\Downloads\LeetCode\typings is not a valid directory. [Info - 12:13:19 am] Assuming Python version 3.10 [Info - 12:13:19 am] Assuming Python platform Windows Search paths for c:\Users\mrmol\Downloads\LeetCode c:\Users\mrmol\.vscode\extensions\ms-python.vscode-pylance-2021.10.3\dist\typeshed-fallback\stdlib c:\Users\mrmol\Downloads\LeetCode c:\Users\mrmol\Downloads\LeetCode\typings c:\Users\mrmol\.vscode\extensions\ms-python.vscode-pylance-2021.10.3\dist\typeshed-fallback\stubs\... c:\Users\mrmol\.vscode\extensions\ms-python.vscode-pylance-2021.10.3\dist\bundled\stubs c:\Users\mrmol\AppData\Local\Programs\Python\Python310\DLLs c:\Users\mrmol\AppData\Local\Programs\Python\Python310\Lib c:\Users\mrmol\AppData\Local\Programs\Python\Python310 c:\Users\mrmol\Downloads\LeetCode\.venv c:\Users\mrmol\Downloads\LeetCode\.venv\Lib\site-packages [Error - 12:13:20 am] Import 'defusedxml.ElementTree' could not be resolved [Error - 12:13:20 am] An error occurred when creating type stub for 'defusedxml.ElementTree': Import 'defusedxml.ElementTree' could not be resolved [Info - 12:13:20 am] Background analysis(3) root directory: c:\Users\mrmol\.vscode\extensions\ms-python.vscode-pylance-2021.10.3\dist [Info - 12:13:20 am] Background analysis(3) started Background analysis message: setFileOpened Background analysis message: getDiagnosticsForRange Background analysis message: getDiagnosticsForRange Background analysis message: setConfigOptions Background analysis message: setImportResolver Background analysis message: ensurePartialStubPackages Background analysis message: setAllowedThirdPartyImports Background analysis message: setTrackedFiles
This is a 3rd party package recommended by python.org.
import defusedxml.ElementTree as ET
I don't quite get why this import can't be resolved when generating type stub because it works fine in code, I get completions on ET. 🤔
ET.
Stub generation works fine if I import the whole module:
import defusedxml
This will be fixed in the next release.
fixed in 2021.11.0
Environment data
Expected behaviour
Type stub created successfully, probably only for imported interfaces but the whole module would be fine as well.
Actual behaviour
An error occurred when creating type stub for 'defusedxml.ElementTree': Import 'defusedxml.ElementTree' could not be resolved
Logs
Code Snippet / Additional information
This is a 3rd party package recommended by python.org.
I don't quite get why this import can't be resolved when generating type stub because it works fine in code, I get completions on
ET.
🤔Stub generation works fine if I import the whole module: