Manual:Pywikibot/Installation/id

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

Permulaan
There are four basic steps to installing pywikibot:
 * 1) Download or update Python,
 * 2) Download pywikibot,
 * 3) Configure pywikibot's basic settings.

Mengunduh Python

 * Unix systems: typically have a recent-enough version of Python installed. Check with.


 * 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 http://www.python.org/downloads/


 * Windows: download and install the latest release Python 2.7.10 from http://www.python.org/downloads/


 * Python version: The following versions of Python are supported:

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.

Mengunduh Pywikibot
Cara termudah untuk mengunduh Pywikibot adalah lewat the latest nightly release. Cukup mengunduh berkas zip Pywikibot dan mengekstrak berkas tersebut. Pywikibot dapat digunakan tanpa perlu proses pemasangan lanjutan.

Mengunduh Pywikibot dengan Git
For installing with Git you need to run: With the  option it automatically installs the required submodules. Currently there is one submodules (i18n), which is really required even for English language bots.

Pintasan di command line
Agar dapat mengembangkan kode sumber di luar direktori sumber pywikipedia, tambahkan kode seperti ini: ke dalam berkas yang dijalankan sewaktu log masuk, biasanya ~/.bashrc - ini menghindari mengetik export PYTHONPATH tiap kali Anda log masuk. Ubah path sesuai instalasi Anda.

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

Memperbarui
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

 * 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 (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 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.

Updating git

 * Bila Anda menggunakan Git untuk mengunduh Pywikipedia, Anda harus masuk ke direktori dan memberi perintah:


 * Bila Anda menggunakan versi rilis harian prosesnya sedikit lebih rumit. Anda harus mengunduh ulang salinan penuh dari [$pwb_nightly]. Sebelum menginstalnya, backup berkas konfigurasi dan skrip Anda (user-config.py, berkas family, atau skrip kustom yang mungkin sudah Anda buat, dan berkas dump xml yang Anda gunakan untuk suatu wiki). Timpa berkas pywikipedia Anda dengan versi baru yang baru Anda unduh. Kembalikan berkas-berkas konfigurasi Anda. Bila Anda tidak yakin dengan yang Anda lakukan, jangan hapus direktori pywkipedia, tapi pertahankan backup direktori lengkap pywikipedia lama Anda, untuk menghindari hilangnya berkas-berkas penting.

Dependencies
Use  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:

For a single package use:

To uninstall a single package use:

Creating user files
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, ) then pywikibot ask questions on how you want to configure your local copy and will create these files. You can also run generate user files.py to create these files.

Running Pywikibot under Windows
Please notice the instruction at Manual:Pywikibot/Windows.

Verifying your installation
With the core branch, entering in the command line python pwb.py login should prompt for the login password for your bot, and then report Logged in on somewiki:lang as bot username.