This is a follow-up to the following question VSCode Python version defaults to 2.7 in the integrated terminal no matter what I do. I would have left it as a comment, but I don’t have enough reputation.
I am running VSCode 1.50.1
on macOS High Sierra 10.13.6
.
I had a problem where the version of Python on integrated terminal defaulted to 2.7.16
, even though the default terminal was running 3.7.1
. I followed the instructions in the above question and low-and-behold, I get the following output:
bash-3.2$ python -V Python 3.7.1
However, I cannot see my home directory as a prompt in my terminal. I looked at the following answer (VSCode terminal not showing current folder) but it suggests adding "terminal.integrated.shellArgs.osx": ["-l"]
into settings.json
, which reverts back to using Python 2.
Is there a way of changing the prompt to the home directory, whilst stilling using Python 3?
EDIT: I have tried selecting Python: Select Interpreter
from the Command Palette, but the terminal still runs Python 2, even though the bottom left corner say I’m using Python 3.7 virtual environment.
Advertisement
Answer
I managed to fix this in the settings: by turning terminal.integrated.inheritEnv
to false.
You can doing this on MacOS by clicking on Code -> Preferences -> Settings. In the search bar, search for terminal.integrated.inheritEnv
and untick the box.