0% found this document useful (0 votes)
2 views4 pages

Python Installation Setup Guide

The document provides a step-by-step guide for setting up Python on Windows, Linux, and macOS. It includes instructions for downloading and installing Python, verifying the installation, installing pip, and setting up an IDE or text editor. Additionally, it covers optional steps for creating a virtual environment on Linux and macOS.

Uploaded by

pritam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Python Installation Setup Guide

The document provides a step-by-step guide for setting up Python on Windows, Linux, and macOS. It includes instructions for downloading and installing Python, verifying the installation, installing pip, and setting up an IDE or text editor. Additionally, it covers optional steps for creating a virtual environment on Linux and macOS.

Uploaded by

pritam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Setting up Python on Windows


Step 1: Download Python Installer

● Go to the official Python website.


● Download the latest version of Python for Windows (recommended the stable version).

Step 2: Run the Installer

● Run the downloaded Python installer.


● Important: Check the box labeled “Add Python to PATH” (this allows Python to be run
from the command line).
● Click on Customize Installation to choose the features or just select Install Now.

Step 3: Verify Installation

● Open Command Prompt.


● Type python --version or python and hit Enter. This should display the Python
version.

Step 4: Install pip (Package Installer)

● Python 3.4 and above includes pip by default.

To check if pip is installed, run:

pip --version

If not installed, you can install it using:

python -m ensurepip --upgrade

Step 5: Set Environment Variables (if needed)

● If you missed adding Python to the PATH during installation:


○ Go to Control Panel > System > Advanced System Settings.
○ Click on Environment Variables.
○ Find Path in system variables and click Edit.
○ Add the path where Python is installed (e.g., C:\Python39\).
Step 6: Install IDE or Text Editor

● Download and install an IDE or text editor (like VS Code, PyCharm, or Sublime Text).

2. Setting up Python on Linux


Step 1: Update Package Index
Open a terminal and run the following to update the package list:

sudo apt update

Step 2: Install Python


For Ubuntu/Debian-based distributions:

sudo apt install python3

For Red Hat/CentOS-based distributions:

sudo yum install python3

Step 3: Verify Installation


Check the installed Python version:

python3 --version

Step 4: Install pip (Package Installer)


Install pip by running:
sudo apt install python3-pip

Verify pip installation:

pip3 --version
Step 5: Set up Virtual Environment (Optional)
Install virtual environment:

sudo apt install python3-venv

Create a virtual environment:

python3 -m venv myenv

Activate it:

source myenv/bin/activate

Step 6: Install IDE or Text Editor

● Use an IDE or text editor like VS Code, PyCharm, Sublime, or Vim.

3. Setting up Python on macOS


Step 1: Check if Python is Pre-installed
Open Terminal and check for Python:

python3 --version

● macOS comes with Python 2.x pre-installed. To install Python 3.x, follow the next steps.

Step 2: Install Homebrew (Package Manager)


If you don’t have Homebrew, install it by running:

/bin/bash -c "$(curl -fsSL


https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 3: Install Python Using Homebrew


Run the following command to install Python:
brew install python
Step 4: Verify Installation
Check Python version:

python3 --version

Check pip:

pip3 --version

Step 5: Set up Virtual Environment (Optional)


Create and activate a virtual environment:

python3 -m venv myenv


source myenv/bin/activate

Step 6: Install IDE or Text Editor

● Download and install an IDE or text editor like VS Code, PyCharm, or Sublime Text.

You might also like