Difficulty: beginner
Estimated Time: 15 minutes

This module will be focused on the pip package manager, in addition to some useful third-party Python modules to start looking at.

F5CA Python 002 Lesson 4 - pip and Some Useful Modules

Step 1 of 4

Practicing with pip

Installing pip

apt update
apt install python3-pip
Confirm it works: pip3

Using pip

Go ahead and use pip to install Flask, which is a really awesome (in my opinion) Python micro web framework.

pip3 install Flask

Notice how it installs dependencies like Jinja (a templating engine).


You can use pip to install specific third-party requirements for your application. To do this:

touch requirements.txt
vim or emacs into requirements.txt
Add this line:
Save the file
pip3 install -r requirements.txt 
pip3 freeze

Notice how it installed python-dateutil version 2.6.0, which is less than the latest version on PyPi, 2.6.1.

A reminder how to use packages (well, you'll need to read their documentation to understand functionality, but here is an example of this particular one):

from dateutil.easter import *