sugarlabs / browse-activity

Sugar activity to browse the internet; WebKit on GTK on Sugar Toolkit
GNU General Public License v2.0
8 stars 44 forks source link

ImportError: No module named collabwrapper #53

Closed binfalse closed 7 years ago

binfalse commented 7 years ago

Just installed a clean sugar on a debian:testing, but the browser is not launching. In ~/.sugar/default/logs/org.laptop.WebActivity-X.log it says:

/usr/share/sugar/activities/Browse.activity/webactivity.py:27: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
/usr/share/sugar/activities/Browse.activity/webactivity.py:29: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import WebKit2
/usr/share/sugar/activities/Browse.activity/webactivity.py:31: PyGIWarning: SoupGNOME was imported without specifying a version first. Use gi.require_version('SoupGNOME', '2.4') before import to ensure that the right version gets loaded.
  from gi.repository import SoupGNOME
/usr/share/sugar/activities/Browse.activity/webactivity.py:37: PyGIWarning: GConf was imported without specifying a version first. Use gi.require_version('GConf', '2.0') before import to ensure that the right version gets loaded.
  from gi.repository import GConf
Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 220, in <module>
    main()
  File "/usr/bin/sugar-activity", line 164, in main
    module = __import__(module_name)
  File "/usr/share/sugar/activities/Browse.activity/webactivity.py", line 53, in <module>
    from collabwrapper.collabwrapper import CollabWrapper
ImportError: No module named collabwrapper
Exited with status 1, pid 7714 data (<open file '<fdopen>', mode 'w' at 0xadd32a70>, dbus.ByteArray('2910a1292e68108c668a90221c42d5a4630bbde9', variant_level=1))

The file /usr/share/sugar/activities/Browse.activity/collabwrapper/collabwrapper.py exists and if I just link it into the Browse.activity directory (same file w/o additional directory):

ln -s /XXX/Browse.activity/collabwrapper/collabwrapper.py /XXX/Browse.activity/collabwrapper.py

and modify the import in https://github.com/sugarlabs/browse-activity/blob/16d967166aeb793f94403c5ccb262e10bf4a0342/webactivity.py#L52 to be:

from collabwrapper import CollabWrapper

It works like a charm. I'm not a python expert and have no idea what that means, but maybe you know?

quozl commented 7 years ago

Thanks. Yes, that's an alternative workaround. Simpler is to add the missing __init__.py file. The file is empty, and marks the collabwrapper directory as a Python module. The file is in the repository, but the Debian package missed it, and could not have been tested. You can see more details at the Debian bug #848840. Root cause is that Browse-200 was released without the collabwrapper directory. Possibly contributing cause is that collabwrapper here is a git submodule, requiring a recursive clone; an additional step for any release or downstream use of git.

If you're okay with this response, I'll close this issue?

binfalse commented 7 years ago

Yes, sure. Thanks a lot for the detailed explanation! :)