Home:ALL Converter>Pipenv on VSCode: Why is (pipenv) not displayed on the terminal?

Pipenv on VSCode: Why is (pipenv) not displayed on the terminal?

Ask Time:2019-08-15T14:44:18         Author:user8491363

Json Formatter

I'm setting up pipenv virtual environment on VSCode Bash terminal but it's not showing (pipenv), which makes it very confusing.

When I was using Pycharm and let it configure pipenv environment, it would automatically display (pipenv) after the project path so it was very easy to tell whether I was on pipenv or not.

After I moved to VSCode, I made a project directory and started a pipenv environment inside it by $ pipenv shell which initialized pipenv stuffs fine but (pipenv) is not displayed on the shell and instead shown on the right corner of the terminal like this: https://imgur.com/a/h3Ji8ZO

How terminal is shown seems to be managed by scripts/activate file but it seems the problem is somewhat related to both pipenv and VSCode so I'm not sure how to address this problem properly.

Here's some of the codes related to my settings.

Jill@Jill-PC MINGW64 /e/VSCodeProjects/likelion (master)
$ pip -V
pip 19.2.1 from c:\users\jill\.virtualenvs\likelion-wdstza1r\lib\site-packages\pip (python 3.6)

Jill@Jill-PC MINGW64 /e/VSCodeProjects/likelion (master)
$ python --version 
Python 3.6.4 :: Anaconda, Inc.

Jill@Jill-PC MINGW64 /e/VSCodeProjects/likelion (master)
$ pipenv --version
pipenv, version 2018.11.26

Author:user8491363,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/57505757/pipenv-on-vscode-why-is-pipenv-not-displayed-on-the-terminal
user8491363 :

To answer my own question, it was because I was rather unfamiliar with how VSCode works.\n\nUnlike IDEs like Pycharm, VSCode doesn't 'remember' the previously used Python interpreter. This means that the Bash you see when you open up VSCode or when you first created a virtual environment with pipenv is not the virtual environment's shell. \n\nYou'll have to first select your Python interpreter from the command palette and close the current bash shell by clicking trash can button and open up the shell again. Then you'll see (venv_name) on the Bash's prompt which indicates that you're on the virtual environment you created. ",
2019-09-03T14:26:42
yy