Test prototype to implicitly use environment variables for terminal activation #20884
Closed
3 tasks done
Labels
Milestone
Refs: #11039
Complexity: 5
Create Issue
Requirements
PATH
during installation.conda init
to initialize the shell if need be.conda create -n testmarch python -y
.python -m venv <name>
to create virtual envs.Verification
Reload window and activate Python extension by opening a Python file.
Select a virtual or conda environment using
Python: Select Interpreter
command.Open terminal, no activation commands should be sent.
Make sure terminal is activated using the selected environment. You can run the following script using
python <script>
in terminal to verify:Output should look something similar to this for `.venv` created via `python -m venv .venv`, make sure `PATH` begins with the activated environment, and `sys.path` has the appropriate directories as well.
The prompt should be visible in most cases (create an issue if it points to the incorrect env):
If nothing is visible, please add a comment here with the type of shell, OS and the Python logs: Prompt does not show up for terminal activation #20827.
Try changing interpreters, terminals should be re-activated with the new env. If a used terminal is currently open, a warning sign should appear to the right of terminal:
Try changing shells using
Select default profile
command, verify terminals are re-activated.Lastly, verify debugging when using
"python"
option works.launch.json
:${command:python.interpreterPath}
with path to an interpreter. This is similar tosys.executable
printed earlier, for eg.C:\Users\karraj\OneDrive - Microsoft\Desktop\folders\crap\.venv\Scripts\python.exe
. Call itA
.Python: Select Interpreter
that is different from the"python"
specified earlier, call itB
.A
, and notB
.The text was updated successfully, but these errors were encountered: