Last modified: 2014-05-10 18:41:43 UTC
I can't use pywikibot in my pc, it return the error "ImportError: No module named httplib2". I'm using core version. $ git pull Already up-to-date. $ git submodule foreach git pull Entering 'externals/httplib2' Already up-to-date. Entering 'scripts/i18n' Already up-to-date. $ python Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pywikibot Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pywikibot/__init__.py", line 427, in <module> from .page import Page, ImagePage, Category, Link, User, ItemPage, PropertyPage, Claim File "pywikibot/page.py", line 17, in <module> import pywikibot.site File "pywikibot/site.py", line 34, in <module> from pywikibot.data import api File "pywikibot/data/api.py", line 13, in <module> from pywikibot.comms import http File "pywikibot/comms/http.py", line 31, in <module> from httplib2 import SSLHandshakeError ImportError: No module named httplib2
There are two ways to use pywikibot 1) as a library. Run "python setup.py develop"; this will install pywikibot in your python library folder 2) as a 'portable app'. In that case, you have to run everything through pwb.py to patch up your paths. Run "python pwb.py scriptname" to run a script, or "python -i pwb.py" to get a shell.
Change 132497 had a related patch set uploaded by Merlijn van Deen: Bug 65089: add 'shell' script https://gerrit.wikimedia.org/r/132497
After that patch is merged, you can also run python pwb.py shell to get an interactive shell (like e.g. Django, where you run 'manage.py shell')
Ok, now it is working :) I used to use the old trunk version and I didn't know that Thank you
Change 132497 merged by jenkins-bot: Bug 65089: add 'shell' script https://gerrit.wikimedia.org/r/132497
Merlijn, the usage should be documented anywhere.
Added to https://www.mediawiki.org/wiki/Manual:Pywikibot/Create_your_own_script