Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Alexa integration #2771

Closed
mtchecker opened this issue Dec 22, 2024 · 9 comments
Closed

Unable to install Alexa integration #2771

mtchecker opened this issue Dec 22, 2024 · 9 comments

Comments

@mtchecker
Copy link

Describe the bug

Alexa integration can not be installed

To Reproduce

After adding the repository in HACS and installing the integration via HA and error occurs.

  1. Go to 'Devices and Services'
  2. Click on 'Add integration'
  3. Scroll down to 'Alexa media player'
  4. See error

Expected behavior

Installation starts

Screenshots

grafik

System details

  • Home Assistant version:
    Core 2024.12.5
    Supervisor 2024.12.0
    Operating System 14.1
    Frontend 20241127.8
  • alexa_media version (from const.py or HA startup log): v5.2.0
  • alexapy version (from pip show alexapy in homeasssistant container or HA startup log):
  • Is Amazon 2FA/2SV enabled <!---We will not debug login issues if unanswered---> (y/n): y
  • Amazon Domain:

Debug Logs (alexa_media & alexapy)
Please provide logs.

Additional context

Log1:

Logger: homeassistant.loader
Quelle: loader.py:1271
Erstmals aufgetreten: 15:27:34 (4 Vorkommnisse)
Zuletzt protokolliert: 15:36:33
Unexpected exception importing platform custom_components.alexa_media.config_flow

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1271, in _load_platform
cache[full_name] = self._import_platform(platform_name)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1303, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/init.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 1022, in exec_module
File "", line 488, in _call_with_frames_removed
File "/config/custom_components/alexa_media/init.py", line 18, in
from alexapy import (
...<9 lines>...
)
File "/usr/local/lib/python3.13/site-packages/alexapy/init.py", line 17, in
from .alexaapi import AlexaAPI
File "/usr/local/lib/python3.13/site-packages/alexapy/alexaapi.py", line 24, in
from .alexalogin import AlexaLogin
File "/usr/local/lib/python3.13/site-packages/alexapy/alexalogin.py", line 76, in
class AlexaLogin:
...<1703 lines>...
self._headers.pop("Content-Type", None)
File "/usr/local/lib/python3.13/site-packages/alexapy/alexalogin.py", line 263, in AlexaLogin
def set_totp(self, otp_secret: str) -> Optional[pyotp.TOTP]:
^^^^^^^^^^
AttributeError: module 'pyotp' has no attribute 'TOTP'

Log2:

Logger: homeassistant.config_entries
Quelle: config_entries.py:3314
Erstmals aufgetreten: 15:27:34 (2 Vorkommnisse)
Zuletzt protokolliert: 15:36:33
Error occurred loading flow for integration alexa_media: Exception importing custom_components.alexa_media.config_flow

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Dec 22, 2024

This appears to be the same as issue #1330

What are the version numbers for pip show pyotp and pip show alexapy?

alexapy version (from pip show alexapy in homeasssistant container or HA startup log): <== No answer provided!

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Dec 22, 2024

"After adding the repository in HACS and installing the integration via HA and error occurs." - Did you restart HA TWICE before trying to install the integration?

@mtchecker
Copy link
Author

HA was restarted several times without a difference.
Executing pip show pyotp and pip show alexapy show "command not found":
grafik

@danielbrunt57
Copy link
Collaborator

danielbrunt57 commented Dec 30, 2024

You can't do it from there! You have to get into the homeassistant container:

image

@mtchecker
Copy link
Author

Is there a tutorial or a instruction how to get into the homeassistant container?
When entering the commands you wrote I won't get the correct response:
grafik

@danielbrunt57
Copy link
Collaborator

Are you using this add-on?

image

image

@mtchecker
Copy link
Author

I used the offical Add-on and now installed the advanced SSH.
With this I am able to read out and it seems that alexapy is not installed:
grafik

How can I install this?

@danielbrunt57
Copy link
Collaborator

pip install alexapy

@mtchecker
Copy link
Author

With that now it finally works! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants