Skip to content

how to auto-activate env (without the command) prior to running code?  #1011

@szw0407

Description

@szw0407

There is an issue with Python extension and this extension.

When a Python script begins to run when we use the run button on the top, usually a new terminal is open, and the program runs with a certain command, for example .venv/bin/python some_py_file.py. It will always be terminated by the extension about 0.1s later, and the extension will run source .venv/bin/activate. It is always annoying as we always need to re-run the Python script.

However, we also need the auto-activate environment feature as it is convenient.

Is it possible to source the command before a Python script runs, instead of interrupting it to activate the environment? Or at least it does not force a KeyboardInterrupt when a script is now running?

log:

KeyboardInterrupt
source SOMEPATH/.venv/bin/activate.fish
vson@VincentMateBook-Air ~/c/data-mining (main) [SIGINT]> source SOMEPATH/.venv/bin/activate.fish

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions