TechieYan Technologies

Weather Program In Python


The climate has a awesome effect on how we pass on approximately our every day activity. On this tutorial, we are able to use Python to help us to show weather forecast reports of a particular metropolis in a very appealing manner.Permit’s first understand what climate forecasting method. It’s far a manner wherein humans/machines try to predict the conditions of the weather for a given place. Now you is probably wondering, how is climate forecasting going to advantage society? And why do I even need to build it?Properly, climate prediction can positively effect human beings’s lives in diverse ways, i can listing some of them below.


  • Tourism is strongly stricken by climate of a certain vicinity
  • It strongly influences the safety and operation of transportation of all paperwork.
  • We even decide our outfits based totally at the weather situations
  • No doubt, it performs a chief function within the farming business.


Request:We can be desiring the requests library of python, which we want to put in within the system using the pip command inside the CMD of your computer.

Pip install requests

Weather Program In Python

Code Description & Execution

Program Methodology

Now, we want to make certain that we introduce the application to the users well. Look at the code snippet underneath. You can alternate the texts in line with your choices

Next, allow’s take the enter of the metropolis name from the consumer the usage of the code

Now, we have the primary stuff geared up and we are prepared to transport to the main a part of the undertaking. We can start out through uploading the requests module that we simply hooked up in our machine in advance.

We are able to create a function as a way to take the name of the metropolis the user enters and prints the file for us. Have a look at the code of the function beneath.

O generate the climate report we can make use of wttr. Now, you might be thinking what wttr is? Wttr is a console-oriented weather forecast carrier that includes a number of statistics illustration ways to ensure you get the climate information within the excellent shape possible.

Ultimately, we just want to request the facts from the wttr link generated with the help of the requests module. We’re utilizing the strive-except block of Python to ensure that we cope with viable errors beforehand.

Weather Program In Python file

How to Execute?

Note: Make sure you have added path while installing the software’s.

  1. Install the prerequisites/software’s required to execute the code from reading the above blog which is provided in the link above.
  2. Press windows key and type in anaconda prompt a terminal opens up.
  3. Go to the directory where your requirement.txt file is present, not just requirement.txt, if you want to execute any .py or .ipynb files, you need to go to that specific folder or path, where they are saved.
  4. <<directory of your file:>>. E.g., If my file is in d drive, then
  5. Type d:
Weather Program In Python exexcution
  1. cd d:\License-Plate-Recognition-main    #CHANGE PATH AS PER YOUR PROJECT, THIS IS JUST AN EXAMPLE
Weather Program In Python command

          7. If your project is in c drive, you can ignore step 4 and go with step 5

          8. Run pip install -r requirements.txt or conda install requirements.txt (Requirements.txt is a text file consisting of all the necessary libraries required for executing this python file. If it gives any error while installing libraries, you might need to install them individually.), example: pip install “module_name”.


Weather Program In Python result

Issues Faced

  1. We might face an issue while installing specific libraries, in this case, you might need to install the libraires manually. Example: pip install “module_name/library” i.e., pip install pandas
  2. Make sure you have the latest or specific version of python, since sometimes it might cause version mismatch.

Click Here To Download This Code And Associated File.


+91 7075575787