|
| 1 | +<div align="center"> |
| 2 | + <img src=""> |
| 3 | +</div> |
| 4 | + |
| 5 | +--- |
| 6 | +# 🐍 Python Modules and pip |
| 7 | + |
| 8 | +Welcome to the Python Modules and pip section! In this section, you'll learn about the modules, types of modules and pip you can use in Python. |
| 9 | + |
| 10 | +## 📚 Table of Contents |
| 11 | + |
| 12 | +- [Modules](#-modules) |
| 13 | +- [pip](#-the-pip-command) |
| 14 | + |
| 15 | +## 🫙 Modules |
| 16 | + |
| 17 | +Modules are like libraries that you can use in your Python code. They contain pre-written functions and classes that you can use to perform various tasks. You can import modules into your code using the `import` statement. |
| 18 | + |
| 19 | +## Types of modules |
| 20 | + |
| 21 | +- **Built-in modules**: These are modules that come pre-installed with Python. You don't need to install them separately. Examples include `math`, `random`, and `time`. |
| 22 | + |
| 23 | +- **External modules**: These are modules that you need to install separately using pip. Examples include `requests` , `pyttsx3` , ` pandas `. |
| 24 | + |
| 25 | +## 📦 The pip command |
| 26 | + |
| 27 | +Pip is a package management system used to install and manage software packages written in Python. It simplifies the process of installing and managing libraries and dependencies in Python projects. |
| 28 | + |
| 29 | +## Key Features |
| 30 | + |
| 31 | +- **Installation of Packages**: Pip allows you to install packages from the Python Package Index (PyPI) and other package indexes. |
| 32 | +- **Dependency Management**: Pip automatically installs any dependencies required by the package you're installing. |
| 33 | +- **Upgrading Packages**: Pip can upgrade installed packages to the latest versions available. |
| 34 | +- **Uninstalling Packages**: Pip can also uninstall packages that are no longer needed. |
| 35 | +- **Requirements Files**: Pip can install all the packages listed in a requirements file, which is a plain text file that contains a list of package names and versions. |
| 36 | + |
| 37 | +## Basic Commands |
| 38 | + |
| 39 | +- **Install a package**: |
| 40 | + ```bash |
| 41 | + pip install package_name #Replace package_name with module name eg. pyttsx3 (pip install pyttsx3) |
| 42 | + ``` |
| 43 | + |
| 44 | +- **Upgrade a package**: |
| 45 | +```bash |
| 46 | + pip install --upgrade package_name #Replace package_name with module name eg. pyttsx3 (pip install --upgrade pyttsx3) |
| 47 | +``` |
| 48 | +- **Uninstall a package**: |
| 49 | +```bash |
| 50 | + pip uninstall package_name #Replace package_name with module name eg. pyttsx3 (pip uninstall pyttsx3) |
| 51 | + ``` |
| 52 | + |
| 53 | +- **List installed packages**: |
| 54 | +```bash |
| 55 | +pip list |
| 56 | +``` |
| 57 | + |
| 58 | +- **Show information about a package**: |
| 59 | +```bash |
| 60 | +pip show package_name #Replace package_name with module name eg. pyttsx3 (pip show pyttsx3) |
| 61 | +``` |
| 62 | + |
| 63 | +- **Install packages from a requirements file**: |
| 64 | +```bash |
| 65 | +pip install -r requirements.txt #Important command if you want to install all the packages listed in a requirements file at once |
| 66 | +``` |
0 commit comments