Manual talk:Pywikibot/user-config.py

Wouldn't this be better off at MediaWiki wiki? – Juliancolton  &#124; Talk 21:02, 30 June 2009 (UTC)
 * Not at the moment, while there is no namespace for third-party tools on mediawiki.org.
 * A report would be needed to ask for opening of [[Bot: namespace. (don't know if it exists already)
 * On mediawikiwiki, content about bots is limited to mw:help:bots (&API). --Al Maghi 21:21, 30 June 2009 (UTC)

Error messages
C:\Users\t\Desktop\pywikipedia>python login.py 'python' is not recognized as an internal or external command, operable program or batch file.

Only login.py works.

user-config.py: mylang = 'en' usernames['dead-wikia.com']['en'] = u'admin' family = dead-wikia.com

Error: C:\Users\t\Desktop\pywikipedia>login.py Traceback (most recent call last): File "C:\Users\t\Desktop\pywikipedia\login.py", line 58, in    import re, os, query File "C:\Users\t\Desktop\pywikipedia\query.py", line 28, in    import wikipedia, time File "C:\Users\t\Desktop\pywikipedia\wikipedia.py", line 143, in    from pywikibot import * File "C:\Users\t\Desktop\pywikipedia\pywikibot\__init__.py", line 15, in  from exceptions import * File "C:\Users\t\Desktop\pywikipedia\pywikibot\exceptions.py", line 13, in  import config File "C:\Users\t\Desktop\pywikipedia\config.py", line 496, in    execfile(_filename) File "C:\Users\t\Desktop\pywikipedia\user-config.py", line 2, in    usernames['dead-wikia.com']['en'] = u'admin' KeyError: '****.com'

user-config.py: mylang = 'en' usernames[dead-wikia.com]['en'] = u'admin' family = dead-wikia.com

Error: C:\Users\t\Desktop\pywikipedia>login.py Traceback (most recent call last): File "C:\Users\t\Desktop\pywikipedia\login.py", line 58, in    import re, os, query File "C:\Users\t\Desktop\pywikipedia\query.py", line 28, in    import wikipedia, time File "C:\Users\t\Desktop\pywikipedia\wikipedia.py", line 143, in    from pywikibot import * File "C:\Users\t\Desktop\pywikipedia\pywikibot\__init__.py", line 15, in  from exceptions import * File "C:\Users\t\Desktop\pywikipedia\pywikibot\exceptions.py", line 13, in  import config File "C:\Users\t\Desktop\pywikipedia\config.py", line 496, in    execfile(_filename) File "C:\Users\t\Desktop\pywikipedia\user-config.py", line 2, in    usernames[dead-wikia.com]['en'] = u'admin' NameError: name 'dead' is not defined

Adamtheclown 11:23, 15 November 2010 (UTC)


 * Problem in my family file

I figured it out:


 * 1) -*- coding: utf-8  -*-

import family

class Family(family.Family):
 * 1) The official Beta Wiki.

def __init__(self):

family.Family.__init__(self) self.name = 'dead' #Set the family name; this should be the same as in the filename.

self.langs = { 'en': 'www.dead-wiki.com', #Put the hostname here. }

def version(self, code): return "1.6.10" #The MediaWiki version used. Not very important in most cases.

def scriptpath(self, code): return '/w/index.php' #The value of on this wiki

def apipath(self, code): return '/w/api.php' #The path of api.php raise NotImplementedError(           "The %s family does not support api.php" % self.name)

Adamtheclown 12:01, 15 November 2010 (UTC)

Confusing insturctions
This is really confusing. The content of the environment variable PYWIKIBOT2_DIR (core)/PYWIKIBOT_DIR (compat). Could mean one or both of these are checked and does not let you know about order. I know not supposed to put support questions here but the article needs changed. Lonjers (talk) 02:34, 2 January 2016 (UTC)

unable to login otherthan wiktionary
I am one of the sysop both in ta.wikipedia and ta.wiktionary. I can login to ta.wiktionary but unable to login ta.wikipedia. i am using compat in ubuntu distro. My user config as follows;-

Pleae, guide me?--Info-farmer (talk) 08:37, 4 October 2016 (UTC)
 * compat was deprecated and abandoned; it's not working anymore, the login module is broken since Autumn 2016. Try to use core, or convince someone with needed skills to fix compat :) --XXN (talk) 20:16, 20 April 2017 (UTC)


 * Thanks. Moving to the core.--Info-farmer (talk) 12:22, 22 April 2017 (UTC)

Can anyone create use this from their desktop PC or can this only be used on the Server hosting the wiki? Thanks! User:SamiIslam 12:58, 21 August 2017 (UTC)

Python 3.9
I feel this page needs updating as Python 3.9 is not offering user-config.py file. Shahab.bot (talk) 17:40, 15 October 2020 (UTC)