PIP
In one line
pip is Python's package installer, used to install and manage third-party packages from PyPI.
In simple words
pip (Pip Installs Packages) is Python's standard package manager. It installs packages from PyPI (Python Package Index), a repository of thousands of third-party libraries.
Common commands:
pip install package_name— install a packagepip install package_name==1.2.3— install a specific versionpip uninstall package_name— remove a packagepip list— show installed packagespip freeze > requirements.txt— save dependencies to a filepip install -r requirements.txt— install from a file
Always use pip inside a virtual environment to avoid polluting the system Python. Modern Python (3.4+) includes pip automatically.
Example
# Install a package
pip install requests
# Install a specific version
pip install django==4.2
# Save dependencies
pip freeze > requirements.txt
# Install from requirements
pip install -r requirements.txt
# List installed packages
pip listpip installs, removes, and lists Python packages from PyPI. Use requirements.txt to track dependencies.
Common confusions
Confused with: npm
The difference: pip is the package manager for Python (installs from PyPI). npm is the package manager for JavaScript/Node.js (inst#installs from npm registry). They serve the same purpose for different ecosystems.
Related terms
Related Resources
Related Lessons
- PIP and Packages
Using pip.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.