What is PyPI?
PyPI (pronounced pie-pee-eye), or the Python Package Index, is the official online repository for third-party Python software.- Anyone can write a Python package and publish it to PyPI.
- When you need a package (like
pandasorrequests), you download it directly from PyPI. - Browse packages at https://pypi.org.
What is pip?
pip is the standard package manager for Python. It comes pre-installed with modern Python installations and allows you to install and manage packages directly from PyPI.requests Module
The requests module is a popular third-party Python library used to send HTTP requests and communicate with REST APIs.
Install it using:
Common pip Commands
What is uv?
uv is a modern, ultra-fast Python package manager written in Rust. It is designed as a replacement for pip, pip-tools, and virtualenv.
Why use uv?
- 🚀 10–100× faster than
pip - 📦 Manages virtual environments
- 🐍 Can install Python interpreters
- ⚡ Uses aggressive dependency caching
Common uv Commands
Sharing Dependencies (requirements.txt)
Instead of sharing your .venv folder, share a requirements.txt file containing your project’s dependencies.
Generate the file
Install dependencies
Using External Packages
Common Mistakes
ModuleNotFoundError
ModuleNotFoundError
Python cannot find the package.Common causes
- The package is not installed.
- The virtual environment is not activated.
- VS Code is using a different Python interpreter.
Name Conflicts
Name Conflicts
Don’t name your script the same as a package.Example:
requests.pyPython will import your file instead of the real requests package.Practice & Exercises
Follow-Along Practice
Practice installing packages, importing modules, and working with the
requests library.💻 VS Code |
🚀 Colab |
📥 DownloadPractice Exercises
Solve exercises on package installation, imports, and API requests.💻 VS Code |
🚀 Colab |
📥 Download
What’s Next?
Working with APIs
Connect to online services using the
requests library.