pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Quickfix add import proposes import that are not available for my python version (ignores sys.version_info)

Open nmoreaud opened this issue 1 year ago • 1 comments

Environment data

Pylance async client (2024.6.1) started with python extension (2024.8.1) Pylance language server 2024.6.1 (pyright version 1.1.364, commit 0618acc5) starting Assuming Python version 3.11.8.final.0 Ubuntu 22.04

Code Snippet

wrong python version

Repro Steps

With a python 3.11 venv, if I type batched and try to add import, VSCode proposes itertools.batched which is not yet available for this version of python.

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3-venv python3.11-dev python3.11-venv
python3.11 -m venv .venv

nmoreaud avatar Jun 28 '24 13:06 nmoreaud

@bschnurr I think it is a dup of your stdlib.json rebuild PR.

heejaechang avatar Jun 28 '24 17:06 heejaechang

use this option - https://github.com/microsoft/pylance-release/blob/main/docs/settings/python_analysis_regenerateStdLibIndices.md

heejaechang avatar Mar 28 '25 23:03 heejaechang