Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does my vscode require me to write "python3" instead of just "python" to run a line of code

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading