File talk:Bots hackathon 2013.pdf

From mediawiki.org
Jump to navigation Jump to search

Known errors[edit]

With Ubuntu 13.04 and Python 2.7.2:

 pywikipedia-rewrite# python pwb.py login
Traceback (most recent call last):
  File "pwb.py", line 50, in <module>
    execfile(sys.argv[0])
  File "scripts/login.py", line 50, in <module>
    import pywikibot
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/__init__.py", line 190, in <module>
    from page import Page, ImagePage, Category, Link, User, ItemPage, PropertyPage, Claim
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/page.py", line 16, in <module>
    import pywikibot.site
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/site.py", line 33, in <module>
    from pywikibot.data import api
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/data/api.py", line 13, in <module>
    from pywikibot.comms import http
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/comms/http.py", line 34, in <module>
    import threadedhttp
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/pywikibot/comms/threadedhttp.py", line 41, in <module>
    import httplib2
  File "/var/www/Personnel/mybot/pywikipedia-rewrite/externals/httplib2/httplib2/__init__.py", line 740, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'
 pywikipedia-rewrite#

I tried to import httplib2 but the error is persisting... JackPotte (talk) 09:57, 26 May 2013 (UTC)

Then valhallasw suggested me to import ssl, and the error includes a strange comment:

 pywikipedia-rewrite# python pwb.py login
Traceback (most recent call last):
  File "pwb.py", line 15, in <module>
    import sys,os,ssl
  File "/usr/local/lib/python2.7/ssl.py", line 60, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: No module named _ssl
 pywikipedia-rewrite#

JackPotte (talk) 13:40, 15 June 2013 (UTC)

root@jackbot:~# dpkg -s python2.7
Package: python2.7
Status: install ok installed
Priority: standard
Section: python
Installed-Size: 628
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Multi-Arch: allowed
Version: 2.7.4-2ubuntu3
Replaces: python-profiler (<= 2.7.1-2), python2.7-minimal (<< 2.7.3-7~)
Depends: python2.7-minimal (= 2.7.4-2ubuntu3), libpython2.7-stdlib (= 2.7.4-2ubuntu3), mime-support
Suggests: python2.7-doc, binutils
Breaks: python-virtualenv (<< 1.7.1.2-2~), vim-athena (<< 2:7.3.547-4), vim-gnome (<< 2:7.3.547-4), vim-gtk (<< 2:7.3.547-4), vim-nox (<< 2:7.3.547-4)
Conflicts: python-profiler (<= 2.7.1-2)
Description: Interactive high-level object-oriented language (version 2.7)
 Version 2.7 of the high-level, interactive object oriented language,
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.
Original-Maintainer: Matthias Klose <doko@debian.org>
root@jackbot:~#

valhallasw made me solved the problem by copying this file:

pywikipedia-rewrite# cp /usr/lib/python2.7/lib-dynload/_ssl.i386-linux-gnu.so .

JackPotte (talk) 14:17, 15 June 2013 (UTC)