microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.67k stars 770 forks source link

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

Open nmoreaud opened 6 days ago

nmoreaud commented 6 days ago

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
heejaechang commented 5 days ago

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