Requirement: To run pywikipediabot, Python v2.4 or higher is required, but Python v3.x isn't currently supported. Some of the code may work on Python version 2.3.
- For Windows, download the latest Python v2.x here (not 3.x version!!)
- For Mac and Unix, Python is already present on Mac OS X and on some Unix versions (although it might be necessary or recommended to update it if you have a very old version).
The easiest way to download pywikipedia is to use the latest nightly release. All you have to do is download pywikipedia to your computer and decompress the file, there is no further installation required.
To allow your source code to be developed outside of the pywikipedia source direction, add something like
PYTHONPATH=$PYTHONPATH:~/pywikipedia/ export PYTHONPATH
to a file that gets run on login, usually ~/.bashrc - this avoids typing the export PYTHONPATH part in each time you log in. Naturally, change paths to match your installation.
Download PyWikipediaBot with SVN
You can use SVN (subversion.tigris.org) to retrieve an up-to-date version of PyWikipediaBot. If you use Windows TortoiseSVN is advised. On a Mac, you can follow these instructions to install SVN. Linux users can also follow the instructions below, but removing the
$ symbol in terminal.
To check out the source code using the command line SVN client use this command:
With either of those commands the source code will be in a new directory inside your current working directory named
pywikipedia (the last argument is used as the destination directory).
For graphical tools, the only information needed is the repository path: http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/
Tip for Windows users
How to make a quick shortcut to run commands (Windows users):
If you're installing Pywikipediabot in a folder such as "My Documents" it may be troublesome to use the "cd" or "chdir" command (command to change the current working directory) to go into the folder all the time to run the bots (For those who don't get what that means, this will help you a lot).
On Windows you can create a shortcut which will open the command box you can use to run bots easily. Just follow these simple steps to create one:
- Open up the folder pywikipedia is installed in, in a window.
- Under File > New select Shortcut.
- Type in "cmd.exe" and hit next.
- You can give a name to the shortcut here, just "Pywikipediabot" is good.
- In the address bar (The text bar above where your files are which tells you where you are) copy the path there.
- Right click on the new shortcut and hit properties and paste that path you copied into the "Start in" text field.
- Hit ok, and now you have a shortcut to open the command line to run bots from.
- If you installed using SVN, updating your working copy is easy. Place yourself in your pywikipedia repertory, and simply type svn update. It will simply update the framework to include the latest changes. Read svn Manual for more precisions.
- If you are using a nightly version, the process is a bit more complicated. You have to re-download a full copy from the same site. Before installing it, backup your configuration files and scripts (user-config.py, any family file, or custom script that you might have created, and any current dump xml file you're using for a wiki). Replace your pywikipedia directory by the new version you just downloaded. Restore your configuration files. If you're not sure of what you're doing, do not erase but keep a backup of your complete old pywikipedia directory, to avoid losing any important files.