-
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.3 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 in PowerShell, or a command prompt.:
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 (recommended, sometimes the auto library installer fails and it's a confusing mess, here are the necessary commands to perform the installs of necessary libraries:
pip3 install colorama
pip3 install geopy
pip3 install requests
pip3 install halo
If you get a permissions error when installing a library on a UNIX-based system (OS X, Linux, BSD), you'll want to follow these instructions:
- Find what folder is having issues with permissions.
- Use the command
sudo chown -R <username> <folder>
, where<username>
is your username, and<folder>
is the folder shown in the command prompt. - Try reinstalling the library.
If the instructions above still don't work, attempt to use the command, but go up one folder from what's outputted.
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.
PyWeather has two setup methods. Going the manual way, or going the not-so-manual way. Make sure that at this point you've already downloaded the latest version of PyWeather from the releases tab, or downloaded it through Git. You can download PyWeather with Git as such:
git clone https://github.com/o355/pyweather.git ./pyweather
cd pyweather
git checkout 0.6.3-beta
PyWeather has an automatic setup script, that does most the hard work for you (including the installation of libraries).
To launch the script, you can either double-click setup.py
, or run python3 setup.py
in the base directory of PyWeather in a command prompt. For double-click users, at most exit points an enter to continue prompt is shown.
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.
If you want to entirely bypass the automatic setup script, you can go ahead and set up PyWeather manually.
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.
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!