Installing Python and Setting Up Environment on Windows, Linux, and Mac
Python programming language logo - Installation guide for Windows, Linux, and Mac
Python is one of the most popular programming languages, widely used for web development, data science, AI, automation, and more. Setting up Python correctly on your system is the first step toward starting your coding journey. In this guide, we will walk you through the process of installing Python and setting up the environment on Windows, Linux, and Mac.
.exe
installer (64-bit recommended).python --version
A virtual environment allows you to manage dependencies efficiently.
pip install virtualenv
virtualenv my_env
my_env\Scripts\activate
To deactivate, use:
deactivate
Before installing Python, update the package list:
sudo apt update && sudo apt upgrade -y
Ubuntu/Debian-based systems:
sudo apt install python3 python3-pip -y
Fedora:
sudo dnf install python3
Arch Linux:
sudo pacman -S python
python3 --version
sudo apt install python3-venv
python3 -m venv my_env
source my_env/bin/activate
To deactivate:
deactivate
Homebrew is a package manager for macOS. Install it using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python
python3 --version
python3 -m venv my_env
source my_env/bin/activate
To deactivate:
deactivate
Setting up Python correctly is essential for a smooth development experience. This guide has covered installation steps for Windows, Linux, and Mac, along with setting up a virtual environment to manage dependencies. Start coding today and explore the endless possibilities Python has to offer!
Stay updated with more tutorials on DeveloperIndian Blog