Skip to content
IT Vizag
← Files, Modules & Packages

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

pip and packages

Lesson 6 of 10 · 2 min read

Install libraries others have built.

🎬 Video version coming soon — read it now

Beyond the standard library, there are more than half a million free packages on PyPI (the Python Package Index), written by people all over the world. pip is the tool that installs them.

Installing a package

In a terminal:

🔒 Code example: sign up free (above) to unlock it.

In Colab, put ! in front to run it as a shell command:

🔒 Code example: sign up free (above) to unlock it.

Many popular packages, including pandas, numpy and matplotlib, are already installed in Colab.

Using it

🔒 Code example: sign up free (above) to unlock it.

Note that the install name and import name are usually the same, but not always: you install beautifulsoup4 and import bs4.

Useful pip commands

🔒 Code example: sign up free (above) to unlock it.

requirements.txt is how you share a project: anyone can recreate your setup with one command.

Packages worth knowing

  • requests: call web APIs
  • pandas, numpy, matplotlib: data analysis and charts
  • scikit-learn: machine learning
  • openai, anthropic, google-genai: AI model SDKs
  • fastapi: build web APIs (in the Production Python course)
  • python-dotenv: load secrets from a .env file

Install safely

Anyone can publish to PyPI, and attackers upload fake packages with names like reqeusts or pandaz, hoping you make a typo. Before installing something unfamiliar:

  • Check the spelling carefully
  • Look it up on pypi.org: downloads, recent releases and a linked source repository are good signs
  • Be especially careful with package names suggested by AI tools. They sometimes invent packages that don't exist, and attackers register those names
Tip: Pin versions in requirements.txt for anything important. "It worked last month" problems are often a package that updated itself.

In one line

pip installs packages from PyPI; save them in requirements.txt, and check names carefully before installing anything unfamiliar.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend