Setting up Python on your system is the first step to getting started with Python programming. This guide covers installation and configuration for Mac, Windows, and Linux, along with setting up VSCode as your Python IDE.
python3 --version
If Python is installed, it will display the version. If not, proceed to the next step.python3 --version
Mac systems often come with Python pre-installed. However, it might not be the latest version.
python --version
pip
, the Python package manager (if not pre-installed):
python -m ensurepip --upgrade
If you forget to check "Add Python to PATH," you’ll need to manually add Python to your system environment variables.
python3 --version
sudo apt update
sudo apt install python3 python3-pip
sudo yum install python3
python3 --version
Linux distributions often include Python by default. Check your version to ensure it's up-to-date.
Ctrl+Shift+X
or Cmd+Shift+X
on Mac).Ctrl+Shift+P
or Cmd+Shift+P
on Mac).Python: Select Interpreter
and choose your installed Python version..py
extension, e.g., hello.py
.print("Hello, Python!")
Ctrl+j
or Cmd+j
).python3 hello.py
Congratulations! You have successfully set up Python on your system and configured VSCode as your IDE. You're now ready to dive into Python programming!"