Error after update to pyton 3.6

After updating my virtual enviroment i get this error. Any idea to fix it?

 2017-11-08 20:10:42 ERROR (MainThread) [homeassistant.components.media_player] Error on device update!
    Traceback (most recent call last):
      File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/helpers/", line 216, in async_add_entity
        yield from entity.async_device_update(warning=False)
      File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/helpers/", line 309, in async_device_update
        yield from self.hass.async_add_job(self.update)
      File "/usr/local/lib/python3.6/asyncio/", line 331, in __iter__
        yield self  # This tells Task to wait for completion.
      File "/usr/local/lib/python3.6/asyncio/", line 244, in _wakeup
      File "/usr/local/lib/python3.6/asyncio/", line 244, in result
        raise self._exception
      File "/usr/local/lib/python3.6/concurrent/futures/", line 55, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/media_player/", line 164, in update
      File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/media_player/", line 146, in refresh_spotify_instance
    AttributeError: 'SpotifyOAuth' object has no attribute 'is_token_expired'

Having the same issue after upgrading python to 3.6 yesterday. Have you had any luck finding an answer?

Hassbian 58.1

Did you see this?

I did not. That did the trick. Thanks.

I don’t get it to work. Can you please post how you solved it?

I did the following (this assumes you’re using hassbian with a virtual environment)

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip3 install --upgrade git+

The pip3 command came from the link RobDYI posted above.

EDIT: Just an FYI. I still appear to be getting errors in the log about Spotify, but the player shows up in HA and works. I was able to play/pause Spotify on my phone from HA on my desktop.