Pip comes with Python 3.4 and later versions, automatically installed during the standard Python installation process. It is the default package installer for Python packages and is required for managing third-party libraries.
Pip is not a standalone tool. It is bundled with Python itself, meaning users don't need to install it separately unless they're using an older version or a custom build. For Python 3.4 through 3.12, pip is included by default on Windows, macOS, and Linux distributions when installing via official installers or package managers.
According to the Python Packaging Authority (PyPA), pip is "the standard package installer for Python." It handles downloading, installing, upgrading, and uninstalling packages from the Python Package Index (PyPI). Without pip, managing dependencies in Python projects becomes more complex.
When you download Python from python.org or use a system package manager like apt (Ubuntu), dnf (Fedora), or Homebrew (macOS), pip is automatically added to your environment. This happens because the Python installer includes the pip module as part of the standard library distribution.
On Windows, the installer offers a checkbox to "Add Python to PATH" and "Install pip." Selecting both ensures pip is available in the command line. On macOS, Homebrew installs pip alongside Python. On Linux, most distros include pip in their repositories, such as python3-pip on Debian/Ubuntu.
For example, on Ubuntu 22.04, running sudo apt install python3 installs both Python and pip. After installation, you can run python3 -m pip --version to confirm pip is present.
Pip may not appear in environments where Python was compiled from source or installed via alternative methods. Some Docker images, minimal Linux containers, or custom build environments omit pip by design to reduce image size.
Another common issue arises when users install Python via third-party tools like pyenv or Anaconda. While Anaconda ships with conda (its own package manager), it still includes pip. However, pyenv doesn't bundle pip by default - you must install it manually after setting up a Python version.
I once encountered this while setting up a CI pipeline on a minimal Alpine Linux container. After installing Python 3.10 via apk add python3, pip --version returned a command not found error. Installing py3-pip resolved it. This shows that even when Python is present, pip isn't guaranteed without explicit installation.
To check if pip is available, run:
python3 -m pip --version
If the command returns a version number like pip 23.2.1 from /usr/lib/python3/dist-packages/pip (python 3.10), pip is working correctly.
If pip is missing, you can install it using ensurepip. Run:
python3 -m ensurepip --upgrade
This command activates pip in the current environment. It's safe to run multiple times and is useful for fixing broken installations.
For systems where ensurepip fails due to network issues or outdated certificates, download get-pip.py from https://bootstrap.pypa.io/get-pip.py and run:
python3 get-pip.py
This method bypasses the system's package manager and installs pip directly.
The table below outlines whether pip is included by default based on installation method.
| Installation Method | Pip Included? | Notes |
|---|---|---|
| Python.org installer (Windows/macOS) | Yes | Always includes pip when selected during setup. |
| apt install python3 (Ubuntu/Debian) | Yes | Requires sudo apt install python3-pip for full functionality. |
| Homebrew (macOS) | Yes | pip is installed with Python; no extra steps needed. |
| pyenv (custom builds) | No | Manual installation required after setting a Python version. |
| Minimal Docker images (Alpine, scratch) | No | Use apk add py3-pip or install via get-pip.py. |
Pip is not a dependency resolver. It resolves direct dependencies but does not handle complex conflict resolution like pip-tools or poetry. It also does not manage virtual environments - that's the role of venvavl or virtualenv.
A common misunderstanding is that pip replaces setuptools or distutils. These are different tools: setuptools handles packaging and distribution, while pip manages installation. You can use both together - for example, pip install . runs setup.py under the hood.
Another misconception: pip is not secure by default. It downloads packages from PyPI, which is public and unverified. Always review package sources and use trusted indexes like --index-url https://pypi.org/simple or private mirrors in enterprise settings.
Suppose you're starting a new Python project and want to install the requests library. You run:
python3 -m pip install requests
If pip is missing, you'll see an error like Command 'pip' not found. To fix it, run:
python3 -m ensurepip --upgrade
Then retry the install. Once successful, you can import requests in your code:
import requests
response = requests.get("https://httpbin.org/get")
print(response.json())
This workflow assumes pip is available. If not, the initial step fails - highlighting why knowing pip's status matters.
Always use virtual environments to isolate project dependencies. Create one with:
python3 -m venv myproject
Activate it:
source myproject/bin/activate
Now run pip install inside the environment. This prevents conflicts between global and project-specific packages.
Use pip check to detect compatibility issues. Run pip list to see installed packages. Upgrade with pip install --upgrade package-name.
For security, pin versions in requirements files. A requirements.txt file might contain:
requests==2.31.0
click==8.1.7
This ensures reproducible builds.
As a developer, I've seen teams waste hours debugging dependency conflicts caused by mixing global and local installs. Using pip within isolated environments avoids those problems entirely.
Understanding whether pip comes with Python is essential for troubleshooting. Most users don't need to worry - it's there. But when it's not, knowing how to restore it saves time and prevents project delays.