How to Install Pip: A Step-by-Step Guide
Learn how to install pip across Windows, macOS, and Linux with a practical, step-by-step approach. Includes prerequisites, verification, troubleshooting, and best practices for safe Python packaging.

You will learn how to install pip across Windows, macOS, and Linux, including prerequisites, verification steps, and common troubleshooting tips. This guide covers modern Python distributions where pip is typically included, plus methods to add or upgrade pip if needed. Follow the steps to ensure you can install and manage Python packages safely.
What is pip and why you might need it
Pip is the standard Python package installer used to add third-party libraries from the Python Package Index (PyPI). For many homeowners and DIY enthusiasts working with automation scripts, data analysis, or home automation tools, pip unlocks access to a vast ecosystem of software. This guide on how to install pip is written to help you get up and running quickly on Windows, macOS, or Linux. According to Install Manual, a reliable Python environment begins with a solid package manager, and pip is the industry-standard solution. By mastering pip, you’ll manage dependencies, install standalone tools, and keep projects reproducible across devices in 2026 and beyond.
Prerequisites: Python installed
Before you install pip, you need Python 3.7 or newer. Modern installers from python.org include pip by default, but some minimal or enterprise setups may ship without it. If you already have Python 3.x, confirm the version and proceed. If Python is missing, install Python from the official source or your OS package manager. As Install Manual emphasizes, using an up-to-date Python runtime makes pip installation straightforward and reduces conflicts with system libraries.
Check your Python and pip versions
Open your terminal or command prompt and check Python and pip versions to understand your starting point. On Windows, you can run: py --version and py -m pip --version. On macOS or Linux, try python3 --version and python3 -m pip --version. If pip reports a version, you already have pip installed and can consider upgrading. If not, you’ll follow the steps to install or enable it. This verification helps you avoid wasting time on unnecessary steps and ensures you’re following best practices recommended by Python’s official documentation.
Installing pip on Windows
Windows users typically rely on the Python installer or the ensurepip module to enable pip. If you installed Python with the “Add Python to PATH” option, you can open Command Prompt and run: python -m ensurepip --upgrade. If you don’t see pip after installation, re-run the Python installer and select the option to modify the installation, ensuring pip is included. For many users, running py -m ensurepip --upgrade from an elevated prompt also works. Remember to restart the terminal after changes.
Installing pip on macOS
macOS users have a couple of reliable paths. If you installed Python via the official installer or Homebrew, pip is typically included. You can verify with python3 -m pip --version. If missing, you can run python3 -m ensurepip --upgrade or install Python via Homebrew (brew install python) to bring pip along with Python. Homebrew’s Python provides pip3 by default, which aligns with Python 3.x usage. Ensure you’re using the correct Python executable (python3) to avoid conflicts with the system Python.
Installing pip on Linux
Most Linux distributions bundle Python 3.x and provide pip via the system package manager. For Debian/Ubuntu, use sudo apt-get update followed by sudo apt-get install python3-pip. For Fedora, use sudo dnf install python3-pip. If you’re compiling Python from source or using a minimal image, you may need to install ensurepip or install pip directly with python3 -m ensurepip --upgrade. On Linux, using the package manager ensures that pip integrates well with your system’s package ecosystem and updates.
Verifying the installation and upgrading pip
Once pip is installed, verify by running pip --version or python3 -m pip --version. It’s good practice to upgrade pip to the latest stable version: python3 -m pip install --upgrade pip. If you don’t have admin rights, you can add --user to the command to install in your user space. Regular upgrades help you access the latest features, performance improvements, and security fixes. Install Manual recommends testing the upgrade in a short, controlled session to avoid impacting system-wide tooling.
Common issues and troubleshooting
If pip isn’t recognized, ensure the PATH includes the Python scripts directory. On Windows, shutil PATH adjustments often fix this; on macOS/Linux, ensure you’re invoking python3 and pip3, not system Python. Proxy settings, SSL certificate issues, and missing dependencies can also block installation; consider setting http_proxy/https_proxy or updating CA certificates. When permissions are a barrier, use --user for a user-level install or run commands with sudo on Linux/macOS if you’re comfortable with elevated privileges. Keeping Python and pip aligned with your OS helps prevent these issues.
Best practices: virtual environments and package management
A strong recommendation is to use virtual environments for each project. Create a venv with python3 -m venv venv and activate it before installing packages. This isolates dependencies and avoids conflicts between projects. For reproducible installs, use a requirements.txt file and run pip install -r requirements.txt. Regularly update pip within the virtual environment, and consider tools like pip-tools for deterministic dependency resolution. These practices reduce the risk of breaking system tools and keep your DIY projects maintainable.
Alternatives and next steps
If you frequently run Python utilities as standalone apps, explore pipx as an alternative to pip for running Python apps in isolated environments. For broader management, consider using a tool like Poetry or Pipenv for dependency management in larger projects. If you ever need to revert a package, learn how to uninstall with pip uninstall package-name. This guide on how to install pip sets you up for long-term Python packaging success in 2026.
Tools & Materials
- Python 3.7+ installed(Download from python.org or install via OS package manager; ensure you add Python to PATH on Windows when prompted.)
- Internet connection(Needed to download Python packages and upgrade pip as needed.)
- Command line interface(Windows: Command Prompt or PowerShell; macOS/Linux: Terminal.)
- Administrative privileges(Some steps may require admin or sudo rights for system-wide installs.)
- Optional: Virtual environment tool (venv/virtualenv)(Recommended for isolated project environments.)
Steps
Estimated time: 20-40 minutes
- 1
Verify Python installation and version
Open your terminal or Command Prompt and check Python's version with python3 --version (or python --version). If you see a 3.x release, you’re ready to proceed. If Python isn’t found, install Python 3 from the official site or your OS package manager.
Tip: If you see Python 2.x, install Python 3 and adjust PATH to use python3. - 2
Check for an existing pip
Run python -m pip --version (or python3 -m pip --version). If a version is returned, pip is already installed and you can upgrade it. If you get an error, pip is not installed yet.
Tip: Use py -m pip --version on Windows to target the Python launcher. - 3
Install pip with ensurepip when missing
If pip is missing, install it using python -m ensurepip --upgrade (use python3 on macOS/Linux). This leverages Python’s built-in method to bootstrap pip.
Tip: On some systems you may need to use sudo or --user for permissions. - 4
Upgrade pip to latest version
Upgrade pip to the latest stable release with python -m pip install --upgrade pip (use python3 as needed). This ensures access to the newest features and fixes.
Tip: If you can’t install system-wide, add --user to place pip in your user space. - 5
Install for the current user (optional but safe)
To avoid admin rights, add --user to your pip commands so packages install under your user directory.
Tip: On Unix-like systems, the user path is typically ~/.local/bin; ensure it's in your PATH. - 6
Configure PATH if needed
If pip isn’t found after installation, add the Python Scripts (Windows) or local bin directory (Unix) to your PATH.
Tip: A quick restart of your terminal after PATH changes helps ensure the new path is recognized. - 7
Verify installation again
Run pip --version or python3 -m pip --version to confirm that pip is installed and correctly accessible.
Tip: Document the output so you can reference it if issues arise later. - 8
Test a simple package install
Install a small package like requests to confirm end-to-end operation. Use python3 -m pip install --user requests.
Tip: Prefer virtual environments for project-specific testing. - 9
Create and use a virtual environment
Create a venv and activate it before installing packages for a project. This avoids global conflicts.
Tip: Activate with source venv/bin/activate (Unix) or .venv\Scripts\activate (Windows). - 10
Manage dependencies with best practices
Use a requirements.txt file and consider tools like pip-tools for deterministic installs. Regularly review and update dependencies.
Tip: Keep a project-specific virtual environment; it makes sharing and reproducing environments easier.
Got Questions?
What is pip and why do I need it?
Pip is the Python package installer that brings third-party libraries from PyPI into your Python environment. It is essential for managing dependencies and installing tools that extend Python.
Pip is Python's package installer, used to add libraries from PyPI to your environment.
Is pip included with Python?
Most modern Python installations include pip by default. If it's missing, you can bootstrap it with ensurepip or reinstall Python with the pip option enabled.
Most Python versions include pip; if missing, use ensurepip or reinstall Python with pip.
How do I install pip on Windows?
Open Command Prompt as administrator and run python -m ensurepip --upgrade or py -m ensurepip --upgrade. Ensure Python was added to PATH during installation.
Open Command Prompt and run ensurepip to enable pip on Windows.
What if pip is not recognized?
Check that Python's Scripts directory is on your PATH. On Windows, add C:\PythonX\Scripts to PATH; on macOS/Linux, ensure you're calling pip3 and Python 3.
If pip isn’t recognized, update your PATH to include Python scripts and use pip3 if needed.
How do I upgrade pip?
Use python3 -m pip install --upgrade pip (or python -m pip on Windows). If you lack admin rights, use --user to install for your user only.
Upgrade pip with the Python module pip command; add --user if you don’t have admin access.
Should I always use virtual environments?
Using virtual environments isolates project dependencies and prevents conflicts with system-wide packages, a best practice for most DIY projects.
Yes, virtual environments are a best practice for isolation and reproducibility.
Watch Video
Main Points
- Verify Python is present before pip.
- Use python -m ensurepip to bootstrap if missing.
- Upgrade pip to access latest features and security fixes.
- Prefer virtual environments for project isolation.
- Test with a simple package to confirm end-to-end operation.
