DEV Community

Cover image for Day 2/100: Installing Python & Setting Up Your Environment
 Rahul Gupta
Rahul Gupta

Posted on

Day 2/100: Installing Python & Setting Up Your Environment

Welcome to Day 2 of the 100 Days of Python series!
Today, we’re going to install Python, set up the right tools, and prepare your system for coding success — whether you're on Windows, macOS, or Linux.


✅ Step 1: Check if Python Is Already Installed

Before installing anything, open your terminal or command prompt and run:

python --version
Enter fullscreen mode Exit fullscreen mode

or

python3 --version
Enter fullscreen mode Exit fullscreen mode

If you see something like Python 3.x.x, you’re good to go! Otherwise, follow the instructions below.


💻 Installing Python (Latest Stable Version)

🔹 For Windows:

  1. Go to the official site: https://python.org
  2. Download the latest Python 3.x installer.
  3. IMPORTANT: During installation, check the box that says:
   ✅ Add Python to PATH
Enter fullscreen mode Exit fullscreen mode
  1. After installation, verify with:
   python --version
Enter fullscreen mode Exit fullscreen mode

🔹 For macOS:

Python 2.x comes pre-installed, but you’ll want the latest 3.x version.

  1. Install Homebrew (if not installed):
   /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode
  1. Then install Python:
   brew install python
Enter fullscreen mode Exit fullscreen mode

🔹 For Linux (Debian/Ubuntu):

sudo apt update
sudo apt install python3 python3-pip
Enter fullscreen mode Exit fullscreen mode

🧪 Step 2: Verify Installation

Run this in your terminal:

python --version
# or
python3 --version
Enter fullscreen mode Exit fullscreen mode

You should see output like:

Python 3.12.0
Enter fullscreen mode Exit fullscreen mode

Also check if pip is working:

pip --version
Enter fullscreen mode Exit fullscreen mode

🖥️ Step 3: Choose a Code Editor

Pick an editor that suits your style. Here are the most popular ones:

✅ Recommended: VS Code

Other Options:

  • PyCharm – Full IDE, great for large projects
  • Sublime Text – Fast and minimal
  • Jupyter Notebook – Excellent for data science

⚙️ Step 4: Install Python Extension (VS Code)

If you're using VS Code:

  1. Open VS Code
  2. Go to the Extensions tab (or press Ctrl+Shift+X)
  3. Search for Python and install the official one from Microsoft

🧪 Step 5: Run Your First Python File

  1. Open VS Code
  2. Create a new file: hello.py
  3. Add this code:
print("Hello, Python World!")
Enter fullscreen mode Exit fullscreen mode
  1. Run it using the terminal:
python hello.py
Enter fullscreen mode Exit fullscreen mode

You should see:

Hello, Python World!
Enter fullscreen mode Exit fullscreen mode

🎉 You just wrote your first Python program!


🧼 Optional: Set Up Virtual Environments

Virtual environments keep your project dependencies isolated.

Create one like this:

python -m venv venv
Enter fullscreen mode Exit fullscreen mode

Activate it:

  • Windows: venv\Scripts\activate
  • macOS/Linux: source venv/bin/activate

Deactivate with:

deactivate
Enter fullscreen mode Exit fullscreen mode

🧠 Recap

  • ✅ Installed Python
  • ✅ Set up code editor (VS Code recommended)
  • ✅ Wrote and ran your first script
  • ✅ Learned about virtual environments

Top comments (0)