Echo Devices (Alexa) as Media Player - Testers Needed

getting errors on my hass.io setup

Unable to prepare setup for platform media_player.alexa: Could not install all requirements.
17:13 setup.py (ERROR)
Not initializing media_player.alexa because could not install requirement lxml==4.2.3
17:13 requirements.py (ERROR)
Unable to install package lxml==4.2.3: Failed building wheel for lxml wirelesstagpy 0.3.0 has requirement colorlog==3.0.1, but you’ll have colorlog 3.1.4 which is incompatible. waterfurnace 0.4.0 has requirement websocket-client>=0.46, but you’ll have websocket-client 0.37.0 which is incompatible. upsmychoice 1.0.6 has requirement beautifulsoup4==4.5.1, but you’ll have beautifulsoup4 4.6.0 which is incompatible. upsmychoice 1.0.6 has requirement python-dateutil==2.6.0, but you’ll have python-dateutil 2.7.3 which is incompatible. upsmychoice 1.0.6 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. toonlib 1.0.2 has requirement cachetools==2.0.0, but you’ll have cachetools 2.0.1 which is incompatible. toonlib 1.0.2 has requirement requests==2.13.0, but you’ll have requests 2.19.1 which is incompatible. temperusb 1.5.3 has requirement pyusb>=1.0.0rc1, but you’ll have pyusb 1.0.0b1 which is incompatible. spotcrime 1.0.3 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. skybellpy 0.1.2 has requirement colorlog==3.0.1, but you’ll have colorlog 3.1.4 which is incompatible. python-velbus 2.0.11 has requirement pyserial==3.3, but you’ll have pyserial 3.1.1 which is incompatible. python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you’ll have pycryptodome 3.6.4 which is incompatible. pysma 0.2.0 has requirement aiohttp<3,>2, but you’ll have aiohttp 3.3.2 which is incompatible. pysma 0.2.0 has requirement async-timeout<3,>2, but you’ll have async-timeout 3.0.0 which is incompatible. pymysensors 0.16.0 has requirement pyserial>=3.4, but you’ll have pyserial 3.1.1 which is incompatible. pymonoprice 0.3 has requirement pyserial>=3.4, but you’ll have pyserial 3.1.1 which is incompatible. pymata 2.14 has requirement pyserial==2.7, but you’ll have pyserial 3.1.1 which is incompatible. pyicloud 0.9.1 has requirement keyring<9.0,>=8.0, but you’ll have keyring 13.2.1 which is incompatible. pyicloud 0.9.1 has requirement keyrings.alt<2.0,>=1.0, but you’ll have keyrings-alt 3.1 which is incompatible. pyblackbird 0.5 has requirement pyserial>=3.4, but you’ll have pyserial 3.1.1 which is incompatible. nad-receiver 0.0.9 has requirement pyserial==3.2.1, but you’ll have pyserial 3.1.1 which is incompatible. myusps 1.3.2 has requirement python-dateutil==2.6.0, but you’ll have python-dateutil 2.7.3 which is incompatible. myusps 1.3.2 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. myusps 1.3.2 has requirement selenium==2.53.6, but you’ll have selenium 3.14.0 which is incompatible. mycroftapi 2.0 has requirement websocket-client==0.44.0, but you’ll have websocket-client 0.37.0 which is incompatible. motorparts 1.0.2 has requirement beautifulsoup4==4.5.1, but you’ll have beautifulsoup4 4.6.0 which is incompatible. motorparts 1.0.2 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. magicseaweed 1.0.0 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. locationsharinglib 2.0.7 has requirement requests==2.18.4, but you’ll have requests 2.19.1 which is incompatible. libsoundtouch 0.7.2 has requirement websocket-client>=0.40.0, but you’ll have websocket-client 0.37.0 which is incompatible. insteonplm 0.11.7 has requirement pyserial==3.2.0, but you’ll have pyserial 3.1.1 which is incompatible. hipnotify 1.0.8 has requirement requests==2.9.1, but you’ll have requests 2.19.1 which is incompatible. fedexdeliverymanager 1.0.6 has requirement beautifulsoup4==4.5.1, but you’ll have beautifulsoup4 4.6.0 which is incompatible. fedexdeliverymanager 1.0.6 has requirement python-dateutil==2.6.0, but you’ll have python-dateutil 2.7.3 which is incompatible. discord-py 0.16.12 has requirement aiohttp<1.1.0,>=1.0.0, but you’ll have aiohttp 3.3.2 which is incompatible. crimereports 1.0.0 has requirement requests==2.12.4, but you’ll have requests 2.19.1 which is incompatible. broadlink 0.9 has requirement pycryptodome==3.4.11, but you’ll have pycryptodome 3.6.4 which is incompatible. alarmdecoder 1.13.2 has requirement pyserial==2.7, but you’ll have pyserial 3.1.1 which is incompatible. abodepy 0.13.1 has requirement colorlog==3.0.1, but you’ll have colorlog 3.1.4 which is incompatible. Command “/usr/local/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-caw06dmi/lxml/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-cng4_9ce/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=” failed with error code 1 in /tmp/pip-install-caw06dmi/lxml/ You are using pip version 10.0.1, however version 18.0 is available. You should consider upgrading via the ‘pip install --upgrade pip’ command.
17:13 util/package.py (ERROR)

Similar issue here

Error Log
2018-08-06 21:09:07 ERROR (SyncWorker_13) [homeassistant.util.package] Unable to install package lxml==4.2.3: Failed building wheel for lxml
wirelesstagpy 0.3.0 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
waterfurnace 0.4.0 has requirement websocket-client>=0.46, but you'll have websocket-client 0.37.0 which is incompatible.
upsmychoice 1.0.6 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.0 which is incompatible.
upsmychoice 1.0.6 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
upsmychoice 1.0.6 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
toonlib 1.0.2 has requirement cachetools==2.0.0, but you'll have cachetools 2.0.1 which is incompatible.
toonlib 1.0.2 has requirement requests==2.13.0, but you'll have requests 2.19.1 which is incompatible.
temperusb 1.5.3 has requirement pyusb>=1.0.0rc1, but you'll have pyusb 1.0.0b1 which is incompatible.
spotcrime 1.0.3 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
skybellpy 0.1.2 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
python-velbus 2.0.11 has requirement pyserial==3.3, but you'll have pyserial 3.1.1 which is incompatible.
python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you'll have pycryptodome 3.6.4 which is incompatible.
pysma 0.2.0 has requirement aiohttp<3,>2, but you'll have aiohttp 3.3.2 which is incompatible.
pysma 0.2.0 has requirement async-timeout<3,>2, but you'll have async-timeout 3.0.0 which is incompatible.
pymysensors 0.16.0 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
pymonoprice 0.3 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
pymata 2.14 has requirement pyserial==2.7, but you'll have pyserial 3.1.1 which is incompatible.
pyicloud 0.9.1 has requirement keyring<9.0,>=8.0, but you'll have keyring 13.2.1 which is incompatible.
pyicloud 0.9.1 has requirement keyrings.alt<2.0,>=1.0, but you'll have keyrings-alt 3.1 which is incompatible.
pyblackbird 0.5 has requirement pyserial>=3.4, but you'll have pyserial 3.1.1 which is incompatible.
nad-receiver 0.0.9 has requirement pyserial==3.2.1, but you'll have pyserial 3.1.1 which is incompatible.
myusps 1.3.2 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
myusps 1.3.2 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
myusps 1.3.2 has requirement selenium==2.53.6, but you'll have selenium 3.14.0 which is incompatible.
mycroftapi 2.0 has requirement websocket-client==0.44.0, but you'll have websocket-client 0.37.0 which is incompatible.
motorparts 1.0.2 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.0 which is incompatible.
motorparts 1.0.2 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
magicseaweed 1.0.0 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
locationsharinglib 2.0.7 has requirement requests==2.18.4, but you'll have requests 2.19.1 which is incompatible.
libsoundtouch 0.7.2 has requirement websocket-client>=0.40.0, but you'll have websocket-client 0.37.0 which is incompatible.
insteonplm 0.11.7 has requirement pyserial==3.2.0, but you'll have pyserial 3.1.1 which is incompatible.
hipnotify 1.0.8 has requirement requests==2.9.1, but you'll have requests 2.19.1 which is incompatible.
fedexdeliverymanager 1.0.6 has requirement beautifulsoup4==4.5.1, but you'll have beautifulsoup4 4.6.0 which is incompatible.
fedexdeliverymanager 1.0.6 has requirement python-dateutil==2.6.0, but you'll have python-dateutil 2.7.3 which is incompatible.
discord-py 0.16.12 has requirement aiohttp<1.1.0,>=1.0.0, but you'll have aiohttp 3.3.2 which is incompatible.
crimereports 1.0.0 has requirement requests==2.12.4, but you'll have requests 2.19.1 which is incompatible.
broadlink 0.9 has requirement pycryptodome==3.4.11, but you'll have pycryptodome 3.6.4 which is incompatible.
alarmdecoder 1.13.2 has requirement pyserial==2.7, but you'll have pyserial 3.1.1 which is incompatible.
abodepy 0.13.1 has requirement colorlog==3.0.1, but you'll have colorlog 3.1.4 which is incompatible.
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-m1vral3b/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-af8m4sio/install-record.txt --single-version-externally-managed --prefix  --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-m1vral3b/lxml/
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2018-08-06 21:09:07 ERROR (MainThread) [homeassistant.requirements] Not initializing media_player.alexa because could not install requirement lxml==4.2.3
2018-08-06 21:09:07 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform media_player.alexa: Could not install all requirements.

Same here!

was getting exited about update but same problems, this use to be so cool with addon hassio, now cant even get it to work!!!
hopefully will come up with a resolution

I’m guessing this all has to do with trying to run the Alexa support on top of HassOS. I have my setup working fine in Hass.io running on top of resinOS. I just installed a fresh copy of Hass.io with HassOS on a separate SD card, copied my snapshot onto it, and started getting all the same errors that people are reporting. HassOS doesn’t appear to be able to install the lxml support that is required, so ends up spitting out a flurry of errors.

This isn’t the first time I’ve had problems with HassOS breaking features that work fine on resinOS. I won’t be making the switch anytime soon.

ya im using HassOS

I am running Hassio. on Docker on a NUC and get the same error. How did you get it to work?

I get this error; no captcha box even.

Error while setting up platform alexa
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 346, in _get_idna_encoded_host
    host = idna.encode(host, uts46=True).decode('utf-8')
  File "/usr/local/lib/python3.6/site-packages/idna/core.py", line 361, in encode
    s = alabel(label)
  File "/usr/local/lib/python3.6/site-packages/idna/core.py", line 284, in alabel
    check_label(label)
  File "/usr/local/lib/python3.6/site-packages/idna/core.py", line 261, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+201C at position 1 of '“amazon' not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 394, in prepare_url
    host = self._get_idna_encoded_host(host)
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 348, in _get_idna_encoded_host
    raise UnicodeError
UnicodeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/media_player/alexa.py", line 104, in setup_platform
    login = AlexaLogin(url, email, password, hass)
  File "/config/custom_components/media_player/alexa.py", line 524, in __init__
    self.login(cookies=cookies)
  File "/config/custom_components/media_player/alexa.py", line 615, in login
    resp = self._session.get(site)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 498, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 309, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 396, in prepare_url
    raise InvalidURL('URL has an invalid label.')
requests.exceptions.InvalidURL: URL has an invalid label.

Still seeing the json error:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 575, in test_loggedin
    post_resp.json()
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 8 column 1 (char 7)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 109, in setup_platform_callback
    login.login(captcha=callback_data.get('captcha'))
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 646, in login
    if self.test_loggedin():
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 576, in test_loggedin
    except (JSONDecodeError, SimpleJSONDecodeError):
UnboundLocalError: local variable 'SimpleJSONDecodeError' referenced before assignment

It’s complaining about a unicode quotation mark in front of the “a” in "amazon. Does your url: setting have quotation marks? Can you try removing or switching to single quotes?

Finally its alive thank you so much for everyone that has worked towards v8.0 this is the first time I have been able to get it to work. So much better then google.tts

Getting the same error as you on Hass.io 0.75.2, running on Ubuntu 16.04 LTS (Odroid XU4).

Cannot initialize media_player.alexa because could not install lxml 4.2.3

Same error for me running HassIO 0.75.2 and Alexa.py 0.8

Not initializing media_player.alexa because could not install requirement lxml==4.2.3

Unable to prepare setup for platform media_player.alexa: Could not install all requirements.

Mine was working with alexa.py ver 0.7.1. and HassIO 0.74.2 Then I added an Amazon Fire TV Cube in the mix and it stopped. That was the only new variable I can think of but it should not matter.

Now I’m running alexa.py ver 0.8 and HassIO 0.75.2 on a Raspberry pie and still not luck

Can I have an example of someones config, like the syntax please?

@gazzaman2k
New PR submitted that should resolve lxml. Finally got myself a hassio install for testing.

@phantomdarkness: I added a dependency requirement for simplejson that may resolve this for you if you’re on hassio. If you’re not, there’s probably a little more logging before that point that will help zero in.

 media_player:
   - platform: alexa
     email: [email protected]
     password: amazon_pass
     url: amazon.com

Thanks! How do I know for sure what amazon.com/amazon.uk etc to use?

Now i’m just getting a timeout reading image error, I think the amazon emailing a verification code is my problem.

It should be where you typically would log in to Amazon. I’ve found that if your’e out of region, you may get less functionality out of your devices (i.e., TTS may not be available).