- Go to the VS Code website: vscode
- Click the "Download for Mac" button (make sure it says "Universal" or matches your chip, like Intel or Apple Silicon/M1/M2/M3
- Once the '.zip' file downloads, double-click it to extract and open the Visual Studio Code app.
- Move VS Code to Applications folder: Drag it into your Applications folder for easy access.
-
Go to the official Python website: python
-
Click "Download Python 3.x.x" (the latest stable version).
-
Open the '.pkg' file once downloaded and go through the installer steps.
-
After installation, open Terminal (you can search for it via Spotlight), and type:
python3 --version
You should see something like 'Python 3.12.3' (or whatever version you installed).
- Open VS Code
- Click the Extensions icon on the sidebar (or press
⇧⌘X). - In the search bar, type Python and install the official one from Microsoft
- Once installed, it will help with syntax highlighting, running Python files, etc.
-
Open a Python file (or create a new one with '.py' extension).
-
In the bottom-left corner, you’ll see
Python x.x.x.Click it. -
Choose the interpreter that says something like:
/usr/local/bin/python3
-
Create a file like
hello.py -
Write:
print("Hello, world!") -
Right-click in the editor and choose "Run Python File in Terminal", or click the Run ▷ button in the top-right.
-
Yay! It works! (Celebration wiggle).
You have now:
- Downloaded and installed VS Code
- Downloaded and installed Python on your computer
- Set up Python in VS Code
- Ran your very first python code!