0

I've recently updated vscode to the most recent version, and whenever I open up a new shell or cmd it activates the venv in that directory, and that's fine and expected as before.

But now it doesn't show the indicator for which python venv is currently active:

shell

I've seen this update in vscode-python Wiki on Github, but the issue now is that whenever I try deactivate on the same terminal it doesn't actually work and current venv is still active.

I know that it's super easy to open a terminal in that folder & continue, but that's really annoying me especially that I'm using terminal very often for quickly debugging my code.

How can I restore it?

6
  • There's probably a way to do this, but why would you want to deactivate the virtual environment? Normally it should contain the complete Python environment that your project needs. Commented Apr 26 at 12:49
  • @Chris Sometimes I need to use global python to run some packages specific commands. For instance I'm using Apify CLI, if I run apify run with current venv active it doesn't recognise my python installation and says python isn't installed please install python on your device (similar message). So using global py was a solution for me. Commented Apr 27 at 15:37
  • I don't know anything about Apify, but if it's looking for a python on the path, it should find one. Can you run python from the terminal? And if it's a Python application, it should probably be installed in an isolated virtual environment, e.g. using pipx. Juggling in and out of Python environments manually sounds like a real pain. Commented Apr 28 at 0:38
  • 1
    I finally had a chance to try this out on Windows 11 and was able to reproduce the issue. Behaviour on my elementaryOS (an Ubuntu Linux derivative) machine is different: running deactivate on that machine does exit the virtual environment. But on Windows, it doesn't seem to work. Commented Apr 29 at 0:41
  • To downvoters and close voters: I've reproduced this. It's a clearly-defined, on-topic question. Please read the mouseover text when you vote negatively. Commented Apr 30 at 0:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.