Skip to content

env/interpreter for equally named project on differet hosts #19859

@iRyoka

Description

@iRyoka

Type: Bug

Behaviour

Expected vs. Actual

Suppose I work with the same project on different machines via remote deveopment. Say, an ssh-machine and a wsl machine. On both machines the project folders are named the same (in fact, have equal absolute paths). But the virtualenvs are named differently. Each time I switch between servers I have to re-selece the python interpreter. I guess, this is due to the fact that the extension relies on the path (not including the machine!) to store the venv name. I would expect it to treat these two folders as different projects for they are located on different servers.

Steps to reproduce:

  1. connect to wsl2 via remote-development
  2. checkout any githab repo to /home/user/repo-name
  3. create a venv for this project, say, via pipenv
  4. set the enterpreter to the generated venv
  5. do the same on another server. The username should be the same to ensure an equal absolute path. However, the new venv name is now different as it is selected randomly.
  6. point the new venv as the current file's interpreter
  7. swith back to wsl; you'll get 'select interpreter' instead of the previously selected one

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda):
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2022.14.0
VS Code version: Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7, 2022-09-14T21:03:37.738Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.0-1017-gcp

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.88GB (1.06GB free)
Process Argv --crash-reporter-id 90747096-2440-441c-83c5-4b8800313892
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 x 2495)
Memory (System) 11.70GB (3.49GB free)
VM 0%
Item Value
Remote SSH: <can't share>
OS Linux x64 5.15.0-1017-gcp
CPUs Intel(R) Xeon(R) CPU @ 2.00GHz (32 x 2000)
Memory (System) 204.45GB (145.41GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30557514
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
hb751961:30553087
dsvsc012cf:30540253
azure-dev_surveyone:30548225
2144e591:30553903
fc301958:30567733

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked onverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions