Modules, PIP, Python Virtual Environment
Currently learning and developing my skills in data science.
Table of Contents
Introduction
What I learned
What I built
Challenges and solutions
Conclusion
Introduction: This week, I focused on understanding Python modules, managing packages with pip, and creating isolated virtual environments to keep project dependencies organized. These foundational skills help maintain clean project setups and make collaboration easier.
Modules are files containing a set of functions you want to include in your application. To import a module, you can use the “import“ keyword. We have built-in modules like platform, datetime, math, json etc.
PIP is a package manager. for Python packages or modules. A package contains all files. needed in a module. To download and install: https://pypi.org/project/pip/
A virtual environment is an environment where you can run and test your projects. without interfering with other projects or the original Python installation.
What I learned:
Key concepts: How to import built-in modules; installing, upgrading, and uninstalling packages using pip commands; managing package versions; and benefits of virtual environments in avoiding conflicts between projects
Frameworks: Python modules like math, json and date, pip commands like cowsay, requests etc. Activating and deactivating virtual environments.
Techniques mastered: exception handling (try/except), read/write files.
What I built
Project Name: Error Handling System
Description: A program that asks the user for a number and divides 100 by that number using exception handling to handle invalid input and division by zero.
Code sample:

Results: The user can input any number of choice and it gets divided by 100. If the user inputs any number that is not a number, it throws an error. Then, the user cannot put the denominator as zero.
Technical Discussion:I used a try/except block to run the code, which takes user input, divides by 100, and prints the results. Then in cases of ValueError and ZeroDivisionError, it prints the messages.
Challenges & Solutions:
Challenge: Confusion about where packages are installed.
Solution: Learned to use virtual environments to isolate package installations per project.
Conclusion
This week’s experience with modules, pip, and virtual environments has been eye-opening. I now appreciate how modular Python projects become and how virtual environments keep everything clean and manageable.




