posit-dev / positron

Positron, a next-generation data science IDE
Other
2.38k stars 70 forks source link

Python: Positron should detect virtual env in working directory of Positron #2745

Open petetronic opened 5 months ago

petetronic commented 5 months ago

From Private Beta user discussion:

Preamble I typically work directly in a terminal (iTerm2) with tmux and launch the editor from the command line. When launched, I would expect Positron to use the running virtual environment.

Steps to reproduce:

cd PositronProjects
cd ml
pyenv virtualenv ml
pyenv activate ml
pip install ipykernel
pyenv versions
* ml --> /Users/$USER/.pyenv/versions/3.11.8/envs/ml (set by PYENV_VERSION environment variable)
positron .

Config

Positron Version: 2024.04.0 (Universal) build 103 Code - OSS Version: 1.87.0 Commit: 9815efef4b4fab420adc12c87bc220e74bb4aa81 Date: 2024-04-10T17:01:07.987Z (8 hrs ago) Electron: 27.3.2 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin x64 23.4.0

petetronic commented 5 months ago

Positron does not select the virtualenv from the working directory that launched Positron as the default Python runtime, but it should detect this and use it by default.