Modules and Packages
Learning Path ⋅ Skills: Packages, Modules, Import System, pip, PyPI, uv, __init__.py, Namespace Packages
In this learning path, you’ll explore how Python’s import system works and how to structure your code using modules and packages. You’ll learn to manage project dependencies with pip and uv, evaluate third-party package quality, and publish your own packages to PyPI. Along the way, you’ll also cover namespace packages, zip imports, and creating README files for your projects.
Modules and Packages
Learning Path ⋅ 14 Resources
Understanding Modules and Packages
Get started with Python’s module and package system. You’ll learn how to organize your code into reusable modules and understand what init.py does.
Course
Python Modules and Packages: An Introduction
In this course, you'll explore Python modules and Python packages, two mechanisms that facilitate modular programming. See how to write and import modules so you can optimize the structure of your own programs and make them more maintainable.
Interactive Quiz
Python Modules and Packages
Interactive Quiz
What Is Python's __init__.py For?
Python's Import System
Explore how Python’s import system works under the hood. You’ll cover absolute and relative imports, advanced import techniques, namespace packages, and zip imports.
Course
Absolute vs Relative Imports in Python
If you've worked on a Python project that has more than one file, chances are you've had to use an import statement before. In this course, you'll not only cover the pros and cons of absolute and relative imports but also learn about the best practices for writing import statements.
Course
Advanced Python import Techniques
The Python import system is as powerful as it is useful. In this in-depth video course, you'll learn how to harness this power to improve the structure and maintainability of your code.
Interactive Quiz
Python import: Advanced Techniques and Tips
Tutorial
Python's __all__: Packages, Modules, and Wildcard Imports
Learn about wildcard imports and the __all__ variable in Python. With __all__, you can prepare your packages and modules for wildcard imports, which are a quick way to import everything.
Tutorial
What's a Python Namespace Package, and What's It For?
In this tutorial, you'll be exploring Python namespace packages: what they are, what they're for, and how you can use them in your package systems. Along the way, you'll create your own set of namespace packages and explore how you might be able to use them in your own projects.
Interactive Quiz
Python Namespace Packages
Tutorial
Python Zip Imports: Distribute Modules and Packages Quickly
Learn what Zip imports are and how to use them in Python. You'll learn to create your own importable ZIP files and make them available for use. Finally, you'll learn how to use the zipimport module to dynamically import code from ZIP files.
Managing Dependencies
Learn how to install and manage third-party packages for your projects. You’ll work with pip and uv, and learn to evaluate package quality.
Course
A Beginner's Guide to pip
What is pip? In this beginner-friendly course, you'll learn how to use pip, the standard package manager for Python, so that you can install and manage additional packages that are not part of the Python standard library.
Interactive Quiz
Using Python's pip to Manage Your Projects' Dependencies
Course
uv vs pip: Python Packaging and Dependency Management
Choosing between uv vs pip? This video course compares speed, reproducible environments, compatibility, and dependency management to help you pick the right tool.
Interactive Quiz
uv vs pip: Managing Python Packages and Dependencies
Course
Managing Python Dependencies
Get up to speed with Python dependency management quickly and go from “writing scripts” to “building applications” with this complete course.
Tutorial
How to Evaluate the Quality of Python Packages
Just like you shouldn't download any file from the Internet, you shouldn't install third-party Python packages without evaluating them first. This tutorial will give you the tool set to evaluate the quality of external Python packages before you incorporate them into your Python projects.
Publishing and Distributing
Share your Python projects with the world. You’ll learn to publish packages on PyPI, bundle applications with PyInstaller, and create effective README files.
Course
Publishing Python Packages to PyPI
In this video course, you’ll learn how to create a Python package for your project and how to publish it to PyPI, the Python Package Index. Quickly get up to speed on everything from naming your package to configuring it using setup.cfg.
Tutorial
Using PyInstaller to Easily Distribute Python Applications
Learn how to use PyInstaller to turn your Python application into an executable with no dependencies or installation required. This is great if you want to distribute applications to users who may or may not be Python developers.
Tutorial
Creating Great README Files for Your Python Projects
Learn how to create, organize, and format high-quality README files for your Python projects.
Interactive Quiz
Creating Great README Files for Your Python Projects
Ready to keep building your Python skills? Continue to the next learning path:
Learning Path
Object-Oriented Programming (OOP)
16 Resources ⋅ Skills: Python, OOP, Classes, Data Classes, Getters, Setters, Property, super(), Magic Methods, Operator Overloading, SOLID, Inheritance, Composition, Mixin Classes, Factory Pattern
You may also be interested in these related learning paths:
Got feedback on this learning path?
Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!
