How to select Python environments in notebook

Gary Fritz 21 Reputation points
2022-11-08T03:18:00.243+00:00

I'm trying to switch to VS for my Python learning / development. Still finding my way around.

I suspect this is a "duh" problem, but I'm having trouble with environments. I can select an env in the Terminal with .venv/Scripts/Activate.ps1, so I can pip-install modules in the environment. But the code I run in my notebook (using the "Jupyter" & related extensions) doesn't use that env. VS has a command to create an env, but I see no way to select the env that the code runs in. VS doesn't seem to pay attention to the .venv dir in my workspace directory, even if I start VS by running code in that dir.

I've googled all over and I can't find an answer. Help?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,853 questions
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 29,186 Reputation points Microsoft Vendor
    2022-11-09T05:14:18.29+00:00

    Hi @Gary Fritz ,

    You may ask this question(technical support) on VS Code related forums(Stack Overflow - VS Code or GitHub - VS Code) for better help, as Visual Studio IDE is different from Visual Studio Code and currently VS Code is not supported on Microsoft Q&A.

    Thanks for your understanding and have a nice day:)

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

0 additional answers

Sort by: Most helpful