Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import x could not be resolvedPylancereportMissingImports - wsl + asdf-vm #2478

Closed
adspacheco opened this issue Mar 16, 2022 · 6 comments
Closed
Labels
waiting for user response Requires more information from user

Comments

@adspacheco
Copy link

Environment data

  • Language Server version: v2022.3.1
  • OS and version: WSL: Arch
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.2 using asdf-vm

Expected behaviour

Import package correctly

Actual behaviour

I am using WSL + ASDF-VM to manage python versions.

image

Enviroment

image

image

Logs

Import "flask" could not be resolved

Code Snippet / Additional information

XXX
@adspacheco adspacheco changed the title Import x could not be resolvedPylancereportMissingImports Import x could not be resolvedPylancereportMissingImports - wsl + asdf-vm Mar 16, 2022
@adspacheco
Copy link
Author

I solved by setting in my settings.json:

{
    "python.analysis.extraPaths": [ "/home/adspacheco/.asdf/installs/python/3.10.2/lib/python3.10/site-packages" ],
}

But if I install other version of python using asdf-vm I will need to add path again ? =\

@judej
Copy link
Contributor

judej commented Mar 16, 2022

Could you please add the log that shows the search paths? Adding the trace logs are described in the troubleshooting guide?

@judej judej added the waiting for user response Requires more information from user label Mar 16, 2022
@adspacheco
Copy link
Author

[Info  - 8:34:38 PM] (2303) Pylance language server 2022.3.2 (pyright d2d8122b) starting
[Info  - 8:34:38 PM] (2303) Server root directory: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist
[Info  - 8:34:38 PM] (2303) No configuration file found.
[Info  - 8:34:38 PM] (2303) No pyproject.toml file found.
[Info  - 8:34:38 PM] (2303) Setting pythonPath for service "python310": "/bin/python"
[Warn  - 8:34:38 PM] (2303) stubPath /home/adspacheco/dev/python310/typings is not a valid directory.
[Info  - 8:34:38 PM] (2303) Assuming Python version 3.10
[Info  - 8:34:38 PM] (2303) Assuming Python platform Linux
[Info  - 8:34:39 PM] (2303) Search paths for /home/adspacheco/dev/python310
[Info  - 8:34:39 PM] (2303)   /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib
[Info  - 8:34:39 PM] (2303)   /home/adspacheco/dev/python310
[Info  - 8:34:39 PM] (2303)   /home/adspacheco/dev/python310/typings
[Info  - 8:34:39 PM] (2303)   /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/...
[Info  - 8:34:39 PM] (2303)   /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs
[Info  - 8:34:39 PM] (2303)   /usr/lib/python3.10
[Info  - 8:34:39 PM] (2303)   /usr/lib/python3.10/lib-dynload
[Info  - 8:34:39 PM] (2303)   /usr/lib/python3.10/site-packages
[Info  - 8:34:39 PM] (2303) Adding fs watcher for library directories:
 /usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/usr/lib/python3.10/site-packages
[Warn  - 8:34:39 PM] (2303) Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Warn  - 8:34:39 PM] (2303) Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Warn  - 8:34:39 PM] (2303) Exception received when installing file system watcher: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
[Info  - 8:34:39 PM] (2303) Adding fs watcher for directories:
 /home/adspacheco/dev/python310
[Info  - 8:34:39 PM] (2303) Searching for source files
[Info  - 8:34:39 PM] (2303) Found 3 source files
[Info  - 8:34:39 PM] (2303) Background analysis(1) root directory: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist
[Info  - 8:34:39 PM] (2303) Background analysis(1) started
(2303) Background analysis message: setConfigOptions
(2303) Background analysis message: setImportResolver
(2303) Background analysis message: ensurePartialStubPackages
(2303) Background analysis message: setTrackedFiles
(2303) Background analysis message: markAllFilesDirty
(2303) Background analysis message: setFileOpened
(2303) [FG] parsing: /home/adspacheco/dev/python310/hello_flask.py (38ms)
[Info  - 8:34:39 PM] (2303) Could not import 'flask' in file '/home/adspacheco/dev/python310/hello_flask.py'
[Info  - 8:34:39 PM] (2303)   Looking in stubPath '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Looking in root directory of execution environment '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Looking in bundled stubs path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stdlib path
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stdlib path
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib'
[Info  - 8:34:39 PM] (2303)   Typeshed path not found
[Info  - 8:34:39 PM] (2303)   Looking for typeshed third-party path
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stubs path
[Info  - 8:34:39 PM] (2303)   Typeshed path not found
(2303) [FG] parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 4ms] (143ms)
(2303) [FG] binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi (57ms)
(2303) [FG] binding: /home/adspacheco/dev/python310/hello_flask.py (3ms)
(2303) Background analysis message: getSemanticTokens full
(2303) [BG(1)] getSemanticTokens full at /home/adspacheco/dev/python310/hello_flask.py ...
(2303) [BG(1)]   parsing: /home/adspacheco/dev/python310/hello_flask.py (41ms)
[Info  - 8:34:39 PM] (2303) Could not import 'flask' in file '/home/adspacheco/dev/python310/hello_flask.py'
[Info  - 8:34:39 PM] (2303)   Looking in stubPath '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/dev/python310/typings'
[Info  - 8:34:39 PM] (2303)   Looking in root directory of execution environment '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/dev/python310'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10/lib-dynload'
[Info  - 8:34:39 PM] (2303)   Looking in python search path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/usr/lib/python3.10/site-packages'
[Info  - 8:34:39 PM] (2303)   Looking in bundled stubs path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve stub package using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/bundled/stubs'
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stdlib path
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stdlib path
[Info  - 8:34:39 PM] (2303)   Attempting to resolve using root path '/home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib'
[Info  - 8:34:39 PM] (2303)   Typeshed path not found
[Info  - 8:34:39 PM] (2303)   Looking for typeshed third-party path
[Info  - 8:34:39 PM] (2303)   Looking for typeshed stubs path
[Info  - 8:34:39 PM] (2303)   Typeshed path not found
[Info  - 8:34:39 PM] (2303) Indexer background runner(2) root directory: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist (index)
[Info  - 8:34:39 PM] (2303) Indexing(2) started
(2303) [IDX(2)] index libraries /home/adspacheco/dev/python310 ...
(2303) [IDX(2)]   read stdlib indices (93ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 3ms] (155ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi (52ms)
(2303) [BG(1)]   binding: /home/adspacheco/dev/python310/hello_flask.py (3ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing_extensions.pyi [fs read 0ms] (11ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing_extensions.pyi (3ms)
(2303) [IDX(2)]   scan packages [found 18 modules over 1 exec env] (125ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing.pyi [fs read 0ms] (38ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing.pyi (15ms)
(2303) [IDX(2)]   index execution environment /home/adspacheco/dev/python310 ...
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/xml/__init__.py [fs read 0ms] (22ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 0ms] (13ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (3ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/types.pyi [fs read 0ms] (30ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/types.pyi (14ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/abc.pyi [fs read 0ms] (2ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/abc.pyi (1ms)
(2303) [BG(1)]   parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi [fs read 0ms] (10ms)
(2303) [BG(1)]   binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi (4ms)
(2303) [IDX(2)]     parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 3ms] (107ms)
(2303) [BG(1)] getSemanticTokens full at /home/adspacheco/dev/python310/hello_flask.py (465ms)
(2303) Background analysis message: analyze
(2303) [IDX(2)]     binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/builtins.pyi (20ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/xml/__init__.py (0ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/xml/__init__.py [found 0] (1ms)
(2303) [BG(1)] analyzing: /home/adspacheco/dev/python310/hello_flask.py ...
(2303) [BG(1)]   checking: /home/adspacheco/dev/python310/hello_flask.py (14ms)
(2303) [BG(1)] analyzing: /home/adspacheco/dev/python310/hello_flask.py (15ms)
(2303) Background analysis message: getSemanticTokens range
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/site-packages/more_itertools/__init__.pyi [fs read 2ms] (6ms)
(2303) [BG(1)] getSemanticTokens range 0:0 - 24:21 at /home/adspacheco/dev/python310/hello_flask.py (6ms)
(2303) Background analysis message: resumeAnalysis
(2303) [BG(1)] indexing: /home/adspacheco/dev/python310/hello_flask.py [found 4] (2ms)
(2303) Indexing Done: /home/adspacheco/dev/python310/hello_flask.py
(2303) [BG(1)] parsing: /home/adspacheco/dev/python310/psycopg2_basic_usage.py [fs read 0ms] (3ms)
(2303) [BG(1)] binding: /home/adspacheco/dev/python310/psycopg2_basic_usage.py (0ms)
(2303) [BG(1)] indexing: /home/adspacheco/dev/python310/psycopg2_basic_usage.py [found 3] (0ms)
(2303) Indexing Done: /home/adspacheco/dev/python310/psycopg2_basic_usage.py
(2303) [BG(1)] parsing: /home/adspacheco/dev/python310/psycopg2_string_composition.py [fs read 0ms] (2ms)
(2303) [BG(1)] binding: /home/adspacheco/dev/python310/psycopg2_string_composition.py (1ms)
(2303) [BG(1)] indexing: /home/adspacheco/dev/python310/psycopg2_string_composition.py [found 4] (0ms)
(2303) Indexing Done: /home/adspacheco/dev/python310/psycopg2_string_composition.py
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/more_itertools/__init__.pyi ...
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/more_itertools/more.pyi [fs read 0ms] (64ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/more_itertools/more.pyi (9ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/more_itertools/recipes.pyi [fs read 1ms] (6ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/more_itertools/recipes.pyi (3ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/more_itertools/__init__.pyi (83ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/more_itertools/__init__.pyi [found 126] (2ms)
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/site-packages/packaging/__init__.py [fs read 0ms] (2ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/packaging/__init__.py (0ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/packaging/__init__.py ...
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/__future__.pyi [fs read 0ms] (1ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/__future__.pyi (1ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/packaging/__about__.py [fs read 1ms] (1ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/packaging/__about__.py (0ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/packaging/__init__.py [found 12] (5ms)
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/site-packages/pkg_resources/__init__.py [fs read 0ms] (78ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/pkg_resources/__init__.py (4ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/pkg_resources/__init__.py ...
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/pkgutil.pyi [fs read 0ms] (8ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/pkgutil.pyi (1ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/pkg_resources/__init__.py [found 71] (11ms)
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/site-packages/pyparsing/__init__.py [fs read 0ms] (6ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/pyparsing/__init__.py ...
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/util.py [fs read 0ms] (1ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/util.py (1ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/exceptions.py [fs read 0ms] (3ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/exceptions.py (1ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/actions.py [fs read 0ms] (1ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/actions.py (1ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/results.py [fs read 1ms] (11ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/results.py (0ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/core.py [fs read 3ms] (47ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/core.py (4ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/helpers.py [fs read 1ms] (13ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/helpers.py (2ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/pyparsing/__init__.py (89ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/pyparsing/__init__.py ...
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing.pyi [fs read 0ms] (12ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stdlib/typing.pyi (6ms)
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/pyparsing/unicode.py [fs read 0ms] (98ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/pyparsing/unicode.py (1ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/pyparsing/__init__.py [found 160] (119ms)
(2303) [IDX(2)]     parsing: /usr/lib/python3.10/site-packages/setuptools/__init__.py [fs read 0ms] (9ms)
(2303) [IDX(2)]     binding: /usr/lib/python3.10/site-packages/setuptools/__init__.py (1ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/setuptools/__init__.py ...
(2303) [IDX(2)]       parsing: /usr/lib/python3.10/site-packages/setuptools/_deprecation_warning.py [fs read 0ms] (0ms)
(2303) [IDX(2)]       binding: /usr/lib/python3.10/site-packages/setuptools/_deprecation_warning.py (0ms)
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi [fs read 1ms] (1ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/extension.pyi (0ms)
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi [fs read 0ms] (6ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi (0ms)
(2303) [IDX(2)]       parsing: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi [fs read 1ms] (1ms)
(2303) [IDX(2)]       binding: /home/adspacheco/.vscode-server/extensions/ms-python.vscode-pylance-2022.3.2/dist/typeshed-fallback/stubs/setuptools/setuptools/depends.pyi (1ms)
(2303) [IDX(2)]     indexing: /usr/lib/python3.10/site-packages/setuptools/__init__.py [found 8] (9ms)
(2303) [IDX(2)]   index execution environment /home/adspacheco/dev/python310 [found 9389 in 427 files] (590ms)
(2303) [IDX(2)] index libraries /home/adspacheco/dev/python310 [found 9389 in 1 exec envs] (811ms)
[Info  - 8:34:40 PM] (2303) Indexer done(2). indexed 427 files

@heejaechang
Copy link
Contributor

which (virtual) environment are you using?

we use the python you specified here (in your case - Setting pythonPath for service "python310": "/bin/python")
image

to get python search path.

it sounds like the path you want (/home/adspacheco/.asdf/installs/python/3.10.2/lib/python3.10/site-packages) is not part of python search path.

what do you see when you run this "import sys; print(sys.path)" with "/bin/python"? if you don't see "/home/adspacheco/.asdf/installs/python/3.10.2/lib/python3.10/site-packages", then you are setting wrong environment for vscode.

extraPath you are using is for cases that python search paths can't be determined statically (ex, sys.path are changed dynamically while running python modules)

regardless you use "asdf-vm" or not, vscode python extension to work properly, you need to set python interpreter correctly. it looks like currently, it always point to "/bin/python" and that will be what we use to set up python environment for vscode.

@judej
Copy link
Contributor

judej commented Apr 18, 2022

Closing old issue. If this is still a problem, please reopen with the information requested. thanks

@judej judej closed this as completed Apr 18, 2022
@yudi-azvd
Copy link

yudi-azvd commented Jun 6, 2022

I had a problem similar to @adspacheco 's. Selecting the correct python environment with asdf solved it for me.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for user response Requires more information from user
Projects
None yet
Development

No branches or pull requests

4 participants