skip to Main Content

When I try to run the Python code on Visual Studio Code it says zsh: command not found: python. I’m sure the Python extension is installed on VS Code and I have Python 3.10.6 and I’m using macOS Monterey 12.5.1

2

Answers


  1. On MacOS, the right command to run Python is python3 instead of python. Make sure your scripts use python3 for better compatibility.

    Login or Signup to reply.
  2. If you have installed the Python extension correctly, you should be able to run the Python code by clicking on the drop-down menu in the top left corner of VsCode’s screen and clicking on "Run Python File"

    Here is the Python extension:
    https://marketplace.visualstudio.com/items?itemName=ms-python.python

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search