1

I was working on a Django project after activating the virtual environment created through pipenv.

The virtual environment name given in brackets (lead-manager-full-stack-8btqndKQ) in the vs code terminal disappears everytime i run python manage.py runserver enter image description here

When i select the powershell as terminal and runs pipenv shell again in order to activate the environment again it shows :

Shell for C:\Users\USER.virtualenvs\lead-manager-full-stack-8btqndKQ already activated. No action taken to avoid nested environments.

But it still doesn't show the virtual environment name inside the brackets like it is supposed to show.

Then i tried to run pipenv shell in cmd and this time it shows the virtual environment name in bracket in the terminal. But whenever i reload the terminal or choose new terminal, it doesn't show the virtual environment.

There must be a way to activate the virtual environment at all time, even after reloading the terminal if i am in a folder containing virtual environment right?

Because activating virtual environment everytime i reload the terminal doesn't seem like a good approach.

Akash p
  • 67
  • 6
  • Where did you start VS code from? I usually activate my pipenv using `pipenv shell` then start VScode using `code .` from that directory. I never "lose" the env like you're describing. – michjnich Apr 01 '21 at 10:39
  • i use `code .` from the directory and vs code opens up, and inside vs code i use `pipenv shell` – Akash p Apr 01 '21 at 10:45
  • 1
    See this question: [Pipenv on VSCode: Why is (pipenv) not displayed on the terminal?](https://stackoverflow.com/questions/57505757/pipenv-on-vscode-why-is-pipenv-not-displayed-on-the-terminal) – evergreen Apr 01 '21 at 12:23
  • 1
    Also, look bottom left(ish) on the bar and select the python version - make sure it's using the right env for the project! – michjnich Apr 01 '21 at 15:07

0 Answers0