Last modified: 2014-05-10 18:41:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67089, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65089 - Error: No module named httplib2
Error: No module named httplib2
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
PC Linux
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-09 19:17 UTC by Danilo
Modified: 2014-05-10 18:41 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danilo 2014-05-09 19:17:50 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
Comment 1 Merlijn van Deen (test) 2014-05-09 19:45:49 UTC
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.
Comment 2 Gerrit Notification Bot 2014-05-09 19:52:08 UTC
Change 132497 had a related patch set uploaded by Merlijn van Deen:
Bug 65089: add 'shell' script

https://gerrit.wikimedia.org/r/132497
Comment 3 Merlijn van Deen (test) 2014-05-09 19:54:22 UTC
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')
Comment 4 Danilo 2014-05-09 20:30:06 UTC
Ok, now it is working :)

I used to use the old trunk version and I didn't know that

Thank you
Comment 5 Gerrit Notification Bot 2014-05-10 07:16:32 UTC
Change 132497 merged by jenkins-bot:
Bug 65089: add 'shell' script

https://gerrit.wikimedia.org/r/132497
Comment 6 xqt 2014-05-10 07:18:05 UTC
Merlijn, the usage should be documented anywhere.
Comment 7 Merlijn van Deen (test) 2014-05-10 18:41:43 UTC
Added to https://www.mediawiki.org/wiki/Manual:Pywikibot/Create_your_own_script

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links