01 Learn
pip installs the tools a project needs.
pip installs and manages Python packages. After the virtual-environment lesson, use it inside the correct project environment.
python -m pip install rich
python -m pip list
python -m pip show rich
The first command installs a package. pip list shows installed packages, while pip show rich displays information about one package.
rich is a direct dependency because this project imports it. A package can also install transitive dependencies that it needs; their exact set can vary by version and environment.
↳Version examples: rich==X.Y.Z means one exact version, rich>=X.Y.Z permits that or newer versions, and rich<X.Y.Z permits lower versions. These are examples, not a promise that every newer version works with older code.
The project requirements.txtrich>=13.7,<15
A manually maintained requirements.txt can name direct dependencies and compatible versions. pip freeze records all installed distributions, including transitive dependencies, so do not overwrite a carefully prepared requirements file without understanding the difference.
Install an existing project’s dependenciespython -m pip install -r requirements.txt
python -m pip --version
Run these commands from the project folder. python -m pip --version helps you check which Python interpreter pip is connected to.
When a downloaded project does not run
- 1. Read the project filesOpen README.md, main.py, and requirements.txt before running commands.
- 2. Create or select .venvUse the Concept 04 workflow to create a local .venv and select its VS Code interpreter.
- 3. Install requirementsRun
python -m pip install -r requirements.txt, then run python main.py.
Troubleshooting a downloaded project
- ModuleNotFoundErrorCheck the selected interpreter, activated environment, and whether requirements were installed there.
- requirements.txt is not foundCheck that the terminal is in the project folder.
- A version does not workRead the error before changing versions; different versions can have different requirements and behavior.
- vreme.json is not foundKeep podaci/vreme.json in the displayed project structure. The example uses pathlib so its path does not depend on the terminal folder.
02 Run locally
Run My Weather Report
Do this in VS Code
Download a real small project, inspect its files, then prepare your local environment and run it.
Download Python project
My Weather Reportvremenski_izvestaj/
├── main.py
├── podaci/vreme.json
├── alati/izvestaj.py
├── requirements.txt
├── .gitignore
└── README.md
The project reads local demonstration weather data and formats a terminal table with rich. It does not call an API or use the internet.
Open and run the downloaded project
- Download and extract the ZIPExtract vremenski_izvestaj.zip, then open the vremenski_izvestaj folder in VS Code.
- Inspect the projectRead README.md, main.py, and requirements.txt. Notice that main.py imports from the alati package.
- Prepare dependenciesCreate/select .venv as in the previous lesson, then install the listed packages.
python -m pip install -r requirements.txt
- Run the reportRun main.py and confirm that the terminal shows the three demonstration cities.
python main.py
↳Expected result: Novi Sad 18 °C
Beograd 20 °C
Subotica 17 °C These are demonstration values, not a current weather forecast.
Before asking Sloby for help
- Check pip’s interpreterRun <code>python -m pip --version</code> and check that it points to the project environment.
- Check the project structureDo not move vreme.json away from podaci or izvestaj.py away from alati.
↳Level 2 complete. You now know how to organize Python code, use packages, prepare a virtual environment, and run a project with its dependencies.
Build confidence independently
Get the project running
Use the downloaded project or another project folder. Diagnose the setup before asking for a direct command.
Your goalIdentify the missing dependency or setup step, check requirements.txt and the interpreter, install what the project needs, run it, and explain which step solved the problem.
projekat/
├── main.py
├── requirements.txt
└── .venv/ # local only
Work in your local VS Code folder
Progressive hints
- Read the error and inspect requirements.txt before changing anything.
- Check the selected interpreter and use python -m pip list.
- If requirements are missing, run python -m pip install -r requirements.txt in the project environment.
Ask Sloby to explain an error, or use Check My Code for the active file. Sloby does not run commands, install packages, activate environments, or run the project for you.