Ravindra BagaleCourses & study guides मराठी Track your progress

Python Modules, pip and Virtual Environments (venv) Explained for Beginners

Ravindra Bagale's Tip — Chala mitrano

Nobody writes everything from zero. Python has thousands of ready libraries. Today we learn to import them, install new ones with pip and keep each project clean with a virtual environment.

What you will learn in this chapter

  • What a module and a package are
  • Different ways to import
  • Useful built-in modules: math, datetime, random, statistics
  • Install packages with pip
  • Create and use a virtual environment
  • Save your packages in requirements.txt
  • Make your own module

Practice data

All names, shops, banks, hospitals and amounts in this chapter are made up for learning. They are not real people or real company numbers.

Concepts in this chapter

  1. P10.1What Is a Module in Python and How to Import It
  2. P10.2Useful Built-in Python Modules: math, datetime, random, statistics
  3. P10.3How to Install Python Packages with pip
  4. P10.4How to Create a Python Virtual Environment (venv)
  5. P10.5How to Use requirements.txt in Python Projects
  6. P10.6How to Create Your Own Python Module