Getting started with Python
Set up your Python workspace
Install Python, choose an editor, make a project folder, and check your Python version.
Lesson 2 of 63
Reading: about 2 min
Lesson + practice: about 12 min
Difficulty: Beginner
On this page4 sections
Install a current Python 3 release using the instructions for your operating system at Python downloads. These lessons require Python 3.10 or newer. Choose an editor that can save plain-text .py files.
Check the installation
Open a terminal. On Windows, try this command first:
python --version
Some Windows installations also provide py. If python does not report Python 3, try this Windows alternative:
py --version
On macOS or Linux, use:
python3 --version
Find your project folder
Create a folder named python-roadmap using your file manager and open it in your editor. You will save hello.py there in the next lesson. To enter that folder from a terminal opened in its parent folder, run the command below. If your terminal is already in python-roadmap, skip this step.
cd python-roadmap
Why this works
Keep the project folder, editor, and terminal pointed at the same place. The terminal runs a file from the folder you name, while the editor may have several similarly named files open. A version number confirms which Python command is available; it does not confirm that your script is in the current terminal folder.
What should the version check display?
Reveal answer
A Python 3.10 or newer version number, such as Python 3.12.1.
Try another case
If Python reports its version but says it cannot open hello.py, what should you check?
Check your answer
Reveal answer
Check the terminal folder, the saved filename and .py extension, and whether the editor saved the file in that folder.
Your progress
Reveal the check answer or reach the end to complete this lesson.