• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
PythonForBeginners.com

PythonForBeginners.com

Learn By Example

  • Home
  • Learn Python
    • Python Tutorial
  • Categories
    • Basics
    • Lists
    • Dictionary
    • Code Snippets
    • Comments
    • Modules
    • API
    • Beautiful Soup
    • Cheatsheet
    • Games
    • Loops
  • Python Courses
    • Python 3 For Beginners
You are here: Home / Basics / How to use Pip and PyPI

How to use Pip and PyPI

Author: PFB Staff Writer
Last Updated: May 20, 2020

Pip – Overview

The pip command is a tool for installing and managing Python packages, such as
those found in the Python Package Index.

It’s a replacement for easy_install.

PIP Installation

Installing PIP is easy and if you’re running Linux, its usually already installed.

If it’s not installed or if the current version is outdated, you can use the
package manager to install or update it.

On Debian and Ubuntu:

$ sudo apt-get install python-pip

On Fedora:

$ sudo yum install python-pip

If you are using Mac, you can simply install it through easy_install:

sudo easy_install pip

PyPI – the Python Package Index

Now, when PIP is installed, we need to find a package to install.

Packages are usually installed from the Python Package Index.

The Python Package Index is a repository of software for the Python programming
language.

Getting Started with PIP

Now, when we know what PIP is and we have it installed on the computer,
let’s see how to use it.

To install a package from the Python Package Index, just open up your terminal
and type in a search query using the PIP tool.

PIP – Commands

Just typing pip in your terminal, should give you the following output on the
screen:

Usage:
pip [options]

Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
zip Zip individual packages.
unzip Unzip individual packages.
bundle Create pybundles.
help Show help for commands.

The most common usage for pip is to install, upgrade or uninstall a package.

PIP – Search

To search for a package, say Flask, type in the following:

pip search Flask

You should see an output with all packages containing the name “Flask” and
a description with that.

Flask-Cache – Adds cache support to your Flask application
Flask-SeaSurf – An updated CSRF extension for Flask.
Flask-Admin – Simple and extensible admin interface framework for Flask
Flask-Security – Simple security for Flask apps
Flask – A microframework based on Werkzeug, Jinja2 and good intentions

Pip – Install a package

We can see that Flask is available.

Flask – A microframework based on Werkzeug, Jinja2 and good intentionsLet’s go ahead and install it

pip install Flask

Pip – Show information

Flask is installed, let’s show information about our newly installed packages.

pip show Flask

—
Name: Flask
Version: 0.10.1
Location: /usr/local/lib/python2.7/dist-packages
Requires: Werkzeug, Jinja2, itsdangerous

Pip – Uninstall a package

If you want to uninstall a package installed by PIP, you can do that as well.

pip uninstall Flask

Uninstalling Flask:
...
.....

Proceed (y/n)?

Successfully uninstalled Flask

Using pip is easy and with it you can easily install packages from Pypi.

More Reading

https://pypi.python.org/pypi
http://www.pip-installer.org/en/latest/
http://flask.pocoo.org/

Related

Recommended Python Training

Course: Python 3 For Beginners

Over 15 hours of video content with guided instruction for beginners. Learn how to create real world applications and master the basics.

Enroll Now

Filed Under: Basics Author: PFB Staff Writer

More Python Topics

API Argv Basics Beautiful Soup Cheatsheet Code Code Snippets Command Line Comments Concatenation crawler Data Structures Data Types deque Development Dictionary Dictionary Data Structure In Python Error Handling Exceptions Filehandling Files Functions Games GUI Json Lists Loops Mechanzie Modules Modules In Python Mysql OS pip Pyspark Python Python On The Web Python Strings Queue Requests Scraping Scripts Split Strings System & OS urllib2

Primary Sidebar

Menu

  • Basics
  • Cheatsheet
  • Code Snippets
  • Development
  • Dictionary
  • Error Handling
  • Lists
  • Loops
  • Modules
  • Scripts
  • Strings
  • System & OS
  • Web

Get Our Free Guide To Learning Python

Most Popular Content

  • Reading and Writing Files in Python
  • Python Dictionary – How To Create Dictionaries In Python
  • How to use Split in Python
  • Python String Concatenation and Formatting
  • List Comprehension in Python
  • How to Use sys.argv in Python?
  • How to use comments in Python
  • Try and Except in Python

Recent Posts

  • Count Rows With Null Values in PySpark
  • PySpark OrderBy One or Multiple Columns
  • Select Rows with Null values in PySpark
  • PySpark Count Distinct Values in One or Multiple Columns
  • PySpark Filter Rows in a DataFrame by Condition

Copyright © 2012–2025 · PythonForBeginners.com

  • Home
  • Contact Us
  • Privacy Policy
  • Write For Us