Manual talk:Pywikibot/Basic use

From MediaWiki.org
Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

Longer lists[edit]

I get the impression that the longer lists of parameters at Copyright.py and Replace.py also have a lot of general parameters. if so, they could be added here. (Took me ages to find an explanation of the "start:" parameter, and the use of "namespace:", so a more complete page general parameters would be great.) Thanks! --Chriswaterguy 02:34, 12 August 2008 (UTC)

Error at running login.py[edit]

I installed pywikibot August 5, 2014. But I have stumbled at running login.py. I was wondering if anybody could help me. my OS is Windows7.

> cd pywikibot.core
> python login.py
python: can't open file 'login.py': [Errno 2] No such file or directory
> cd pywikibot.core
> python scripts\login.py
Traceback (most recent call last):
 File "scripts\login.py", line 58, in <module>
   import pywikibot
ImportError: No module named pywikibot
> cd pywikibot.core
> cd scripts
> python login.py
Traceback (most recent call last):
 File "login.py", line 58, in <module>
   import pywikibot
ImportError: No module named pywikibot
Finally,
> python pwb.py login.py
It worked.

I'm having a similar error message when trying to log in for the first time:

$ python login.py
Traceback (most recent call last):
  File "login.py", line 20, in <module>
    import pywikibot
ImportError: No module named pywikibot

Can anyone help please? 129.78.56.196 06:25, 29 April 2015 (UTC)

anyone help me. Im also getting this message--Maathavan (talk) 11:24, 29 January 2016 (UTC)
As far as I know, the "no module named pywikibot" error suggests you don't have the $PYTHONPATH variable set properly.
In a Linux environment
$ echo $PYTHONPATH
should yield something like:
/home/yourusername/pywikibot/core
Hope the above helps. Steinlaus (talk) 04:03, 16 February 2016 (UTC)