posit-dev / posit-dev/positron
Positron reports the wrong Python version if you change the version used in a project
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
System details:
Positron and OS details:
Positron Version: 2024.08.0 (Universal) build 48
Code - OSS Version: 1.91.0
Commit: ed616b36655fb24d116108bdd833f1321704315b
Date: 2024-08-19T04:26:51.868Z
Electron: 29.4.0
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0
Interpreter details:
Python
Describe the issue:
I frequently switch between Python versions in testing and development work in the same project. Positron remembers the Python version from the virtual env from first use, even after if I destroy and recreate the venv and restart the interpreter.
Here's a screen recording of the steps mentioned below.
https://github.com/user-attachments/assets/61429f08-aabf-4413-980e-d9e3da63c939
Steps to reproduce the issue:
- Create a virtual environment for a Python version, e.g. 3.12, in a new project.
- Start the Python interpreter in Positron.
- Delete the
.venvand create a new virtual env for a new Python version, e.g. 3.9. - Restart the Python interpreter in Positron.
- On first launch it reports both 3.12 and 3.9; on restarts it reports having launched 3.12 (the original version).
uv venv -p 3.12
uv pip install ipykernel
# start Positron interpreter and check sys.version
# stop Positron interpreter
rm -rf .venv
uv venv -p 3.9
uv pip install ipykernel
# start Positron interpreter again and check sys.version
Expected or desired behavior:
Positron should report the actual python version in use in the virtual environmet.
Were there any error messages in the UI, Output panel, or Developer Tools console?
No.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the listed uv venv commands and inspect the Python interpreter startup and version-reporting flow. No file or test is named in the report, so locate the code handling interpreter identity across environment recreation. Done means Positron consistently reports the active virtual environment's Python version after restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100