Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode doesn't Run/Debug python with pyenv's virtualenv #20141

Closed
AlexSkyBell opened this issue Nov 2, 2022 · 2 comments
Closed

VSCode doesn't Run/Debug python with pyenv's virtualenv #20141

AlexSkyBell opened this issue Nov 2, 2022 · 2 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@AlexSkyBell
Copy link

AlexSkyBell commented Nov 2, 2022

Type: Bug

Behaviour

Expected vs. Actual

Expected: Run
Actual: Doesn't Run

Steps to reproduce:

  1. install pyenv
  2. install python with pyenv (I tried 3.6.15 version)
  3. choose ~/.pyenv/versions/3.6.15/bin/python as interpreter
  4. make a simple python script, for example:
# main.py
print('hello')
  1. make launch.json with this code (actually, it's standard template):
{
    "configurations": [
        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "program": "main.py",
            "console": "integratedTerminal",
            "justMyCode": true
        }
    ]
}
  1. Press F5 and make sure it does nothing

I tried last version of vscode and python extension on last Fedora 36 and last Debian 11.5.0. Also tried vscode which was downloaded from official website and snap-version. Alos tried 1.71 version of vscode and August version of python extension
P.S. If I choose standard /usr/bin/python3 then all works fine.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.15
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
  • 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)

Experiment 'pythonaacf' is active
LSP Notebooks experiment is enabled
LSP Notebooks interactive window support is enabled
Python interpreter path: ~/.pyenv/versions/3.6.15/bin/python
DAP Server launched with command: /home/alex/.pyenv/versions/3.6.15/bin/python /home/alex/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter
Starting Pylance language server.
DAP Server launched with command: /home/alex/.pyenv/versions/3.6.15/bin/python /home/alex/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter

User Settings


languageServer: "Pylance"

Extension version: 2022.16.1
VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:16:26.920Z)
OS version: Linux x64 6.0.5-200.fc36.x86_64 snap
Modes:
Sandboxed: No

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz (12 x 4200)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
Load (avg) 1, 1, 1
Memory (System) 31.12GB (23.63GB free)
Process Argv --no-sandbox . --crash-reporter-id 01cd247f-40b4-4331-a522-34261ef2f886
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
azure-dev_surveyone:30548225
vscccc:30566498
pyindex848cf:30577861
nodejswelcome1:30587005
fc301958:30595537
2e4cg342:30596373

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 2, 2022
@brettcannon brettcannon changed the title VSCode doesn't Run/Debug python with pyenv's virtuanenv VSCode doesn't Run/Debug python with pyenv's virtualenv Nov 2, 2022
@AlexSkyBell
Copy link
Author

Oh... Python extension doesn't support debugging < 3.7? 😭
I found same bug report #19799
I try all other versions (3.7 ... 3.12) with/without pyenv - and it works fine.

@karrtikr
Copy link

karrtikr commented Nov 3, 2022

Yes, sorry we gotta do a better job of highlighting it to the user: #19988. #19559 might be of interest to you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants