Home > front end >  Why does my vscode require me to write "python3" instead of just "python" to run
Why does my vscode require me to write "python3" instead of just "python" to run

Time:08-10

I understand that the fact that having to type "python3" or "pip3" instead of "python" and "pip" respectively is an annoyance at worst, however it makes me paranoid that other things that I install to my vscode will also have to be run differently. Every other programmer that I watch doesn't have to do so.

zsh: command not found: python

Could it possibly be an issue with my pathing of my downloads?

CodePudding user response:

This, of course, has nothing to do with VSCode and everything to do with the install of Python on your machine. However, it is strange to not have the Python available with just python at the shell.

In any case, one simple way to solve this issue is to open (or create) ~/.zshrc and add the following line:

alias python="python3"

This is a common thing in particular for macOS users, where python often points to the pre-installed Python2.7.

Restarting terminal/VSCode after making this change should fix your issue.

  • Related