Jump to: navigation, search

Other languages:
العربية • ‎català • ‎English • ‎British English • ‎español • ‎suomi • ‎français • ‎Bahasa Indonesia • ‎italiano • ‎日本語 • ‎한국어 • ‎Lëtzebuergesch • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎українська • ‎中文
If you need more help on setting up your Pywikibot visit the IRC channel #pywikibotconnect @ freenode server or Pywikibot mailing list.

For installing or updating compat see Manual:Pywikibot/Installation/compat, To update or install via SVN see Manual:Pywikibot/Installation/SVN.

Initial setup[edit | edit source]

There are four basic steps to installing pywikibot:

  1. Download or update Python,
  2. Download pywikibot,
  3. Configure pywikibot's basic settings.

Downloading Python[edit | edit source]

Unix systems
typically have a recent-enough version of Python installed. Check with python --version.
Mac OS X 10.8+
has a version of Python that is recent enough to run pywikibot. If you run an older OS X, or are unsure, download and install Python 2.7.10 from
download and install the latest release Python 2.7.10 from
Python version
The following versions of Python are supported:
Python version pywikibot compat
Manual:Pywikibot/Compat deprecation
pywikibot core
Former release pywikipedia trunk pywikibot rewrite branch
(pip included)
<= 2.4 no support no support
2.5 Unicode bug. Don't use it with Wikimedia projects.[1]
2.6.0 — 2.6.4 Unicode bug. Don't use it with Wikimedia projects.[1]
2.6.5 — 2.6.9 Should run. Deprecated
2.7.0 — 2.7.1 Unicode bug. Don't use it with Wikimedia projects.[1] no support.
2.7.2 — 2.7.10 OK. Deprecated OK
3.0 — 3.2 no support no support
3.3 — 3.4 OK
  1. 1.0 1.1 1.2 See T102461 for details.

Note Note: Due to a Unicode bug in the underlying python library, Python 2.7.0 and 2.7.1 are not supported using the Core branch. See also the requirements for a bot, which describes needed python version and pywikibot branches.

Download Pywikibot[edit | edit source]

The easiest way to download Pywikibot is to use the latest nightly release. Just download the pywikibot zip file to your computer and decompress the file – there is no further installation required.

Download Pywikibot with Git[edit | edit source]

For installing with Git you need to run:

git clone --recursive

With the --recursive option it automatically installs the required submodules. Currently there is one submodules (i18n), which is really required even for English language bots.

Shortcut in command line[edit | edit source]

To allow your source code to be developed outside of the pywikibot source directory, add something like:


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.

Similarly, you can set the PYWIKIBOT2_DIR environment variable to specify the directory in which user-specific information is stored (in particular, which contains login data for the bot).

Updating[edit | edit source]

The pywikibot framework is a perpetual beta software. Bugfixes, new options, new behavior and changes of the mediawiki software leads to frequently new releases and needs the working copy code to be up to date. Please update your branch regularly (daily period or at least once a week).

Updating nightly dump[edit | edit source]

  • If you are using a nightly version, the process is a bit more complicated. You have to re-download a full copy from here. Before installing it, backup your configuration files and scripts (, 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 pywikibot 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 pywikibot directory, to avoid losing any important files.
If you have changed some scripts of the framework, you have to merge the differences by yourself. Version control systems like git or svn does it automatically.

Updating git[edit | edit source]

  • If you used Git for downloading Pywikibot, you must go to the your directory and run the following command:
git pull --all
  • You may need to do
    git submodule update
    as well, if you need up-to-date i18n files.

Labs[edit | edit source]

Dependencies[edit | edit source]

Use pip package management system to install dependencies. It is included by Python 2.7.9 and Python 3.4. To install all dependencies just run the following command (keeping in mind that some dependencies will require MySQL Connector C++ Libraries):

pip install --user --upgrade pip
pip install -r requirements.txt --allow-external pYsearch --allow-unverified pYsearch

For a single package use:

pip install package-name

To uninstall a single package use:

pip uninstall package-name

Additional configuration[edit | edit source]

Creating user files[edit | edit source]

As a final step before using the bot scripts, you have to create user configuration files. The main one is If you execute your favorite script after installation (for example, python -simulate) then pywikibot ask questions on how you want to configure your local copy and will create these files. You can also run generate user to create these files.

Running Pywikibot under Windows[edit | edit source]

Please notice the instruction at Manual:Pywikibot/Windows.

Verifying your installation[edit | edit source]

With the core branch, entering in the command line

python login

should prompt for the login password for your bot, and then report

Logged in on somewiki:lang as bot username.