wardellbagby / HangoutsBot

Python 3 Bot for Hangouts
GNU General Public License v3.0
38 stars 25 forks source link

ImportError: cannot import name 'schemas' #41

Open SeeJayEmm opened 8 years ago

SeeJayEmm commented 8 years ago

I have recently updated the hangups (and related) package and am receiving the following error when I launch HangoutsBot.

Traceback (most recent call last):
  File "Main.py", line 49, in <module>
    from Core.Bot import HangoutsBot
  File "/home/chris/HangoutsBot/Core/Bot.py", line 21, in <module>
    from Core import Handlers
  File "/home/chris/HangoutsBot/Core/Handlers.py", line 11, in <module>
    from Core.Commands import *  # Makes sure that all commands in the Command directory are imported and registered.
  File "/home/chris/HangoutsBot/Core/Commands/DefaultCommands.py", line 10, in <module>
    from hangups import schemas
ImportError: cannot import name 'schemas'

This is a list of my currently installed python packages.

aiohttp (0.17.3)
appdirs (1.4.0)
asyncio (3.4.3)
beautifulsoup4 (4.3.2)
boto (2.38.0)
chardet (2.3.0)
CherryPy (3.7.0)
colorama (0.3.3)
command-not-found (0.3)
ConfigArgParse (0.9.3)
dateutils (0.6.6)
devscripts (2.15.8ubuntu1)
distribute (0.7.3)
enum34 (1.0.4)
eyeD3-pip (0.6.19)
hangups (0.3.4)
hangups-robobrowser (0.5.2)
hangups-urwid (1.2.2.dev0)
html5lib (0.999)
httplib2 (0.9.1)
language-selector (0.1)
lxml (3.4.4)
Magic-file-extensions (0.2)
nltk (3.0.4)
parsedatetime (1.4)
pip (8.0.2)
protobuf (3.0.0a3)
purplex (0.2.4)
pycurl (7.19.5.1)
pygobject (3.16.2)
python-apt (1.0.1+ubuntu0.1)
python-dateutil (2.4.2)
python-debian (0.1.23)
pytz (2015.2)
readlike (0.1.1)
ReParser (1.4.3)
repoze.lru (0.6)
requests (2.6.0)
robobrowser (0.5.2)
Routes (2.1)
setuptools (20.0)
six (1.7.3)
ssh-import-id (4.5)
ufw (0.34)
unattended-upgrades (0.1)
urllib3 (1.10.4)
urwid (1.3.1)
virtualenv (1.11.6)
WebOb (1.4.1)
Werkzeug (0.10.4)
wikipedia (1.4.0)

Thanks

wardellbagby commented 8 years ago

You're going to want to checkout the hangups_0_3_0_fix branch and use that. I haven't merged it to nightly or master yet but I will soon.

SeeJayEmm commented 8 years ago

Switched to the hangups_0_3_0_support branch. I had to install the sympy package.

Client unexpectedly disconnected:
no such table: focus
Traceback (most recent call last):
  File "/home/chris/HangoutsBot/Core/Bot.py", line 115, in run
    loop.run_until_complete(self._client.connect())
  File "/usr/lib/python3.4/asyncio/base_events.py", line 343, in run_until_complete
    return future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/hangups/client.py", line 102, in connect
    yield from self._listen_future
  File "/usr/lib/python3.4/asyncio/futures.py", line 385, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 288, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.4/asyncio/tasks.py", line 239, in _step
    result = coro.send(value)
  File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 209, in listen
    yield from self._longpoll_request()
  File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 338, in _longpoll_request
    yield from self._on_push_data(chunk)
  File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 370, in _on_push_data
    yield from self.on_receive_array.fire(data_array)
  File "/usr/local/lib/python3.4/dist-packages/hangups/event.py", line 50, in fire
    yield from gen
  File "/usr/local/lib/python3.4/dist-packages/hangups/client.py", line 291, in _on_receive_array
    yield from self.on_state_update.fire(state_update)
  File "/usr/local/lib/python3.4/dist-packages/hangups/event.py", line 48, in fire
    gen = observer(*args, **kwargs)
  File "/home/chris/HangoutsBot/Core/Bot.py", line 307, in _on_state_update
    UtilBot.update_focus(state_update.focus_notification)
  File "/home/chris/HangoutsBot/Core/Util/UtilBot.py", line 691, in update_focus
    if cursor.execute("SELECT * FROM focus WHERE conv_id = ? AND user_id = ?", (conv_id, user_id)).fetchone():
sqlite3.OperationalError: no such table: focus
wardellbagby commented 8 years ago

Man, I knew that would come back to bite me. You're gonna have to delete your database.db file if you want it to work with the newest version OR downgrade hangups back to <0.3.0.

Keep in mind that your database.db file contains karma and reminders,

SeeJayEmm commented 8 years ago

I tried starting clean and that error went away. There's a handful of config issues with the default config.json that I can detail in a separate issue if you'd like.

I'm also encountering a problem with /udefine that I can also detail in a separate issue if you'd like. (I don't know how far behind the main branch this one is so I don't want to make unnecessary work for you.)

Arinerron commented 8 years ago

Got this error too. Any way this could be fixed soon?