#๐Ÿ”’ VS Code interpreter doesn't switches to venv interpreter when I enable venv

6 messages ยท Page 1 of 1 (latest)

sinful steppe
#

So i was developing the project and made a venv say by running command python3 -m venv xyzenv then when i run the command source xyzenv/bin/activate to enable venv the terminal venv changes and runs all files with modules only in venv but the VS code doesn't switches interpreter shows in problem section beside terminal "module not found error" and same when trying to run it throught the play button "module not found" it gets fixed when i maunally change the interpreter using Ctrl + Shift + P but basically my VS code and terminal are kinda not connected this way??? is there a way my VS code also switches interpreter to venv one

Note: I am using WSL my repo and python is on WSL only VS code is installed on windows

fading bisonBOT
#

@sinful steppe

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hoary tinsel
#

I don't use VSC much, but: I don't think VSC is meant to "track" your terminal; I think you're supposed to use Ctrl+Shift+P to set the interpreter.

#

if you then run a terminal inside VSC, it should have the venv activated.

fading bisonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.