×

Advanced Coding & Software Engineering Program

Duration: 1 Year (12 Months)

Join our premium 1-year program to master cutting-edge technologies and become an industry-ready Software Engineer!

Course Coverage

  • Languages: C, C++, Java, JavaScript, Python
  • Web Technologies: HTML, CSS, Bootstrap 5, MERN Stack, Full Stack Development
  • Databases: MySQL, MongoDB
  • Data Science Libraries: Pandas, NumPy
  • Development Tools: Visual Studio Code, IntelliJ IDEA, PyCharm, Postman, Git, GitHub
  • Cloud Platforms: Vercel, MongoDB Atlas

Program Highlights

  • Live Classes: Interactive sessions with real-time doubt resolution
  • Hands-On Sessions: Practical coding exercises to build real-world skills
  • Industry Experts: Learn from professionals with years of experience
  • Live Project: Work on real-world projects to apply your skills
  • Get Certificate: Earn a professional certificate upon program completion

Course Fee: Only ₹1020 / month
Limited Period Offer!

Installing Python & Setting Up the Environment



Last Updated on: 1st Aug 2025 19:22:37 PM

This guide provides a step-by-step explanation of how to install Python on Windows, Mac, and Linux, set up popular Integrated Development Environments (IDEs) like Visual Studio Code (VS Code) and PyCharm, and write your first Python program. The content is designed to be beginner-friendly, professional, and easy to follow.

 

Installing Python on Windows, Mac, and Linux

Python is a cross-platform language, and installing it is straightforward on Windows, macOS, and Linux. Follow the steps below for your operating system to install the latest version of Python 3 (recommended over Python 2, which is deprecated).

 

Installing Python on Windows

  1. Visit the Official Python Website
    Open your web browser and go to python.org. The website automatically detects your operating system and suggests the latest Python 3 version (e.g., Python 3.12.x as of August 2025).

  2. Download the Installer

    • Click the "Download Python 3.x.x" button to download the executable installer for Windows.

    • Choose the appropriate installer for your system (e.g., 64-bit or 32-bit, depending on your system architecture).

  3. Run the Installer

    • Double-click the downloaded .exe file to start the installation.

    • Important: Check the box that says "Add Python 3.x to PATH". This ensures you can run Python from the command line without specifying its full path.

    • Select "Install Now" for a standard installation, or choose "Customize installation" to select specific features (e.g., pip, documentation).

  4. Verify the Installation

    • Open the Command Prompt (press Win + R, type cmd, and press Enter).

    • Type python --version and press Enter. You should see the installed Python version (e.g., Python 3.12.x).

    • Also, check pip --version to ensure the package manager is installed.

  5. Test Python

    • In the Command Prompt, type python and press Enter to open the Python interactive shell.

    • Try a simple command like print("Hello, Python!") to confirm Python is working.

 

Installing Python on macOS

  1. Visit the Official Python Website
    Navigate to python.org and download the macOS installer for the latest Python 3 version.

  2. Run the Installer

    • Open the downloaded .pkg file and follow the on-screen instructions.

    • The installer will guide you through a wizard. Accept the defaults unless you have specific requirements.

  3. Verify the Installation

    • Open the Terminal (search for "Terminal" in Spotlight or find it in Applications > Utilities).

    • Type python3 --version to check the installed Python version (macOS typically uses python3 to distinguish from the system’s pre-installed Python 2).

    • Verify pip with pip3 --version.

  4. Test Python  

    • In the Terminal, type python3 to enter the Python interactive shell.

    • Run print("Hello, Python!") to ensure Python is functioning.

Note: macOS may come with Python 2 pre-installed. Always use python3 and pip3 to work with Python 3.

 

Installing Python on Linux

Most Linux distributions (e.g., Ubuntu, Fedora, CentOS) come with Python pre-installed. However, you may need to install or update to the latest version.

  1. Check for Pre-Installed Python

    • Open a terminal and type python3 --version to check if Python 3 is already installed.

    • If not installed or outdated, proceed to install the latest version.

  2. Install Python on Ubuntu/Debian-based Systems

    • Update the package list: sudo apt update.

    • Install Python 3: sudo apt install python3 python3-pip.

    • Verify with python3 --version and pip3 --version.

  3. Install Python on Fedora-based Systems

    • Update the package list: sudo dnf update.

    • Install Python 3: sudo dnf install python3 python3-pip.

    • Verify with python3 --version and pip3 --version.

  4. Install Python on Other Linux Distributions

    • For other distributions, use the appropriate package manager (e.g., yum for CentOS, zypper for openSUSE).

    • Alternatively, download and compile Python from source:

      • Download the source code from python.org.

      • Extract and compile using commands like ./configure, make, and sudo make install.

  5. Test Python

    • In the terminal, type python3 to open the Python shell.

    • Run print("Hello, Python!") to confirm the installation.

Note: Always use python3 and pip3 on Linux to avoid conflicts with Python 2, if present.

 

Setting Up IDEs: VS Code and PyCharm

An Integrated Development Environment (IDE) enhances your coding experience by providing tools like code completion, debugging, and project management. Below are steps to set up two popular IDEs for Python: Visual Studio Code (VS Code) and PyCharm.

 

Setting Up Visual Studio Code (VS Code)

VS Code is a lightweight, free, and highly customizable code editor with excellent Python support.

  1. Download and Install VS Code

    • Visit code.visualstudio.com and download the installer for your operating system (Windows, macOS, or Linux).

    • Run the installer and follow the prompts to install VS Code.

  2. Install the Python Extension

    • Open VS Code.

    • Go to the Extensions view by clicking the Extensions icon in the sidebar or pressing Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS).

    • Search for “Python” and install the official Python extension by Microsoft.

    • This extension provides features like IntelliSense, linting, debugging, and code formatting.

  3. Configure Python Interpreter

    • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).

    • Type Python: Select Interpreter and select the installed Python version (e.g., Python 3.12.x).

    • If Python is not detected, ensure it’s added to your system’s PATH or specify the path manually.

  4. Set Up a Python Project

    • Create a new folder for your project (e.g., MyPythonProject).

    • Open the folder in VS Code: File > Open Folder.

    • Create a new file with a .py extension (e.g., hello.py).

    • VS Code will automatically recognize Python files and enable features like code completion.

  5. Install Additional Tools (Optional)

    • Install a linter for code quality (e.g., pylint or flake8): pip install pylint.

    • Configure VS Code to use the linter via Settings (Ctrl+, or Cmd+,) and search for “Python Linting.”

    • Enable auto-formatting with tools like black or autopep8 for consistent code style.

  6. Run Python Code

    • Write a Python script (e.g., print("Hello from VS Code!")) in a .py file.

    • Right-click the file and select Run Python File in Terminal, or use the Run button (triangle) in the top-right corner.

 

Setting Up PyCharm

PyCharm is a powerful, Python-specific IDE with advanced features for professional development. It offers a free Community Edition and a paid Professional Edition.

  1. Download and Install PyCharm

    • Visit jetbrains.com/pycharm and download the Community Edition for free.

    • Run the installer and follow the prompts for your operating system.

  2. Create a New Project

    • Open PyCharm and select Create New Project.

    • Choose a project location and select the Python interpreter (PyCharm should automatically detect your installed Python version).

    • If needed, click the gear icon next to the interpreter field to manually select or install Python.

  3. Configure PyCharm

    • PyCharm comes pre-configured with features like code completion, debugging, and version control integration.

    • To customize, go to File > Settings (Windows/Linux) or PyCharm > Preferences (macOS) to adjust themes, fonts, or keybindings.

  4. Install Additional Packages

    • Go to File > Settings > Project > Python Interpreter.

    • Click the + icon to search for and install packages (e.g., numpy, requests) via pip.

    • Alternatively, use the built-in terminal (pip install package_name).

  5. Run Python Code

    • Create a new Python file: File > New > Python File.

    • Write a simple script (e.g., print("Hello from PyCharm!")).

    • Right-click the file and select Run or use the Run button in the toolbar.

 

Comparison of VS Code and PyCharm

  • VS Code: Lightweight, highly customizable, free, and ideal for beginners or those working with multiple languages. Requires manual setup for Python features.

  • PyCharm: Python-specific, feature-rich, and ideal for large projects or professional development. Community Edition is free, but some advanced features require the Professional Edition.

 

Writing Your First Python Program

Now that Python and an IDE are set up, let’s write and run your first Python program—a simple script that prints a greeting.

Step-by-Step Guide

  1. Open Your IDE

    • Launch VS Code or PyCharm and open your project folder.

  2. Create a New Python File

    • In VS Code: File > New File, name it hello.py, and save it.

    • In PyCharm: File > New > Python File, name it hello.py.

  3. Write the Code
    Add the following code to hello.py:

     
    # This is a simple Python program
    name = input("Enter your name: ")
    print(f"Hello, {name}! Welcome to Python programming!")
     

    Explanation:

    • input("Enter your name: ") prompts the user to enter their name and stores it in the name variable.

    • print(f"Hello, {name}!...") uses an f-string to display a personalized greeting.

  4. Run the Program

    • In VS Code: Right-click the file and select Run Python File in Terminal, or use the Run button.

    • In PyCharm: Right-click the file and select Run ‘hello’, or click the Run button.

    • In Terminal/Command Prompt: Navigate to the folder containing hello.py (e.g., cd MyPythonProject) and run python3 hello.py (Linux/macOS) or python hello.py (Windows).

  5. Interact with the Program

    • When prompted, enter your name (e.g., “Alice”).

    • The program will output: Hello, Alice! Welcome to Python programming!

  6. Debugging Tips

    • If you encounter errors, check for typos or ensure Python is correctly installed and added to PATH.

    • Use the IDE’s debugging tools (e.g., breakpoints in PyCharm or VS Code) to step through code and identify issues.

 

Additional Tips for Beginners

  • Virtual Environments: Use virtual environments to manage project-specific dependencies and avoid conflicts. Create one with python -m venv myenv and activate it:

    • Windows: myenv\Scripts\activate

    • macOS/Linux: source myenv/bin/activate

  • Learn Basic Commands: Familiarize yourself with Python’s interactive shell (python or python3) to experiment with code snippets.

  • Explore Documentation: Visit docs.python.org for tutorials, references, and guides.

  • Practice Regularly: Start with simple programs and gradually explore libraries like math, random, or datetime to build more complex projects.

 

Conclusion

Installing Python and setting up an IDE like VS Code or PyCharm is a straightforward process that prepares you for Python development. By following the steps outlined above, you can install Python on Windows, macOS, or Linux, configure a powerful development environment, and write your first Python program. This foundation sets the stage for exploring Python’s vast capabilities in web development, data science, automation, and more. Happy coding!


Online - Chat Now
Let’s Connect

Inquiry Sent!

Your message has been successfully sent. We'll get back to you soon!

iKeySkills Logo