-
Notifications
You must be signed in to change notification settings - Fork 7
Setup
For those wanting a more detailed, and less error-prone way to set up PyWeather, you can follow the instructions here.
These instructions assume you have PyWeather 0.6 beta. For older versions, you're on your own.
To run PyWeather, you'll need a system with Python 3 installed, and the ability to install libraries with pip. Nearly every Python setup should be able to do this.
Windows users: It's important that you add Python to your PATH. To test if Python is in your PATH, try running this command:
pip
.
If you see something, Python is in your PATH. Otherwise, reinstall Python, and be sure to select the option to add Python to your PATH.
At this point, if you plan on using PyWeather's automatic setup, you can stop here. If you plan on going the manual way, or would rather have all your libraries installed first, here are the necessary commands to perform the installs of necessary libraries:
pip3 install geopy
pip3 install geocoder
pip3 install requests
pip3 install configparser
If you somehow get an error when installing these packages (especially on Linux), you may want to prefix sudo -H
when installing these libraries. An error that would require the usage of prefixing sudo -H
usually happens on Python versions less than 3.5
.
If the pip3
command doesn't work for you, try using pip
instead. Some odd Python setups replace pip3
with pip
, something that annoys me.
(you know how python
is associated with python 2.7, and python3
is associated with 3.6? how come pip
gets associated with 3.6, and then pip3
is associated with 3.6 too? pip
by default should be associated with 2.7! /rant ends)
PyWeather has two setup methods. Going the manual way, or going the not-so-manual way.
PyWeather has an automatic setup script, that does most the hard work for you (including the installation of libraries).
Termux users: You'll most likely have to use the command pip install requests
before launching PyWeather Setup, as you'll run into an error early in the program. Error checking for the requests package should arrive in 0.6.1 beta.
To launch the script, you can either double-click, or run python3 setup.py
in the base directory of PyWeather in a command prompt.
For people running unusual Python setups: If python3
doesn't work, try using python
instead. If you run into an error, post the traceback as an issue.
After that, PyWeather Setup guides you through obtaining an API key, configuring PyWeather, and doing all that fun stuff.
Once you're done, go ahead and run pyweather.py. Enjoy the weather! If you ran into an issue, don't be afraid to report your issue. I'm not a mean person, and I'll help you out to the best that I can.
If you like driving manual cars, or like challenging yourself, the manual setup is a little more challenging.
Experienced users only. If you find yourself getting stuck at any point, or don't like the complexity, you can always go the automatic way.
We're going to assume that you want to entirely skip the automated setup file.
Before we begin, you'll first have to provision your config file, as is new in PyWeather versions 0.6 and above. You can do that by using the configsetup.py
script in the storage
folder. Double click it, run it with either python3
or python
, depending on your setup.
After your config file gets provisioned, you'll need to obtain an API key. Head over to wunderground.com/api, sign up for a developer anvil key. The process with no account at first gets confusing, so you might want to sign up for a Wunderground account before you actually sign up for a key.
Got that API key? Good. Put that in a file called apikey.txt
, and put it in your, you guessed it, storage
folder. If you want to have a backup of your key, in case the file is open and your cat, dog, fish, monkey, etc. walks over your keyboard, messing up the file, create a file called backkey.txt
, and put it in the backup
folder, as is the default.
Note: Any time you change the KEYBACKUP/savedirectory option in the config, you'll want to move the backkey.txt file to the new folder specified.
That's it! Enjoy PyWeather.
Sidenote: All configuration options are available in config.ini, available in the storage
folder. A config readme is also provided, with detailed information about what each config option does.
If you run into an error during the manual setup, make sure you report the error, be it your fault, or a bug in the coding. I'd really like to know so I can refine PyWeather. Report an issue, especially with the full error!