Home:ALL Converter>Is python interpreter in vscode using pipenv or venv

Is python interpreter in vscode using pipenv or venv

Ask Time:2021-10-27T16:09:21         Author:danialsaufi

Json Formatter

I selected my python interpreter to be the one pipenv created with pipenv shell in vscode. Then if I open the terminal/cmd manually or run a script using the play button up on the right, the new terminal/cmd opened will run the activate script which runs the terminal in the virtual environment. My question here is, is it using my pipenv environment or venv environment? Because if i run the pipenv shell or pipenv install, it will say that "Pipenv found itself running within a virtual environment, so it will automatically use that environment...". And also if i type exit, instead of terminating that environment, it closes the terminal.

Author:danialsaufi,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/69734988/is-python-interpreter-in-vscode-using-pipenv-or-venv
Steven-MSFT :

You are using the python interpreter which is shown at the bottom-left of the VSCode.\nEven you activate a virtual environment created by pipenv in the terminal, it will have no affection on the new terminal and execute the python code.\nAnd if the pipenv found it was in a virtual environment it will not create a new virtual environment with the command pipenv install. And if you execute pipenv shell, it is still in the virtual environment which you activated before. And you can check which python you are using to verify it.",
2021-10-28T08:08:45
yy