pip - The Python Package Installer - Cheatsheet

By xngo on March 2, 2019

pip is the package installer for Python. It is used to install and manage packages in your computer. Below are examples of the commonly using pip commands.

# List all installed packages.
    pip list
# Show package information of [packagename].
    pip show [packagename]
# Search package called 'mysql-connector'
    pip search mysql-connector
# Download packages locally to be used offline.
    pip download -d "/download/package/dir/" [packagename]
    # Or, use a filelist.txt
    echo "pandas" > requirement.txt
    echo "numpy" >> requirement.txt
    pip download -d "/download/package/dir/" -r requirement.txt
# Install packages from local directory.
    pip install --no-index --find-links file://"/download/package/dir/" -r requirement.txt

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.