[Python] VSCode Error when running tests causing 30 second delay everytime I run a test

Discussão em 'Python' iniciado por Stack, Março 4, 2025.

  1. Stack

    Stack Membro Participativo

    Hopefully someone can help on this one. When using the vscode UI to run my tests, everytime there is a 30 second delay before the test run starts because of the below error that I see in the output panel. I have no idea what's causing it though.

    My virtual environment is created through venv and it's name is .venv, and I can activate it just fine in the terminal, but it seems as though maybe vscode is running into an error trying to activate it?

    [​IMG]

    Pasting the text as well for your reference, although I've changed the path to say "mypath" and the user name to say "me" :)

    2023-06-25 11:57:42.306 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/printEnvVariables.py
    2023-06-25 11:57:42.306 [info] shell: bash
    2023-06-25 11:58:12.313 [error] getActivatedEnvironmentVariables [Error: Command failed: . /Users/mypath/.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /Users/me/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/printEnvVariables.py

    at ChildProcess.exithandler (node:child_process:409:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1121:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
    code: null,
    killed: true,
    signal: 'SIGTERM',
    cmd: ". /Users/mypath/.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /Users/me/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/printEnvVariables.py"
    }
    2023-06-25 11:58:12.354 [info] DAP Server launched with command: /Users/mypath/.venv/bin/python /Users/me/.vscode/extensions/ms-python.python-2023.8.0/pythonFiles/lib/python/debugpy/adapter

    Continue reading...

Compartilhe esta Página