Where to run a Script?

  • Hi there

    I am (i hope) on the last leg of installing alexa pi… and the last section requires me to write a script in order to access an online page to gain the credentials for a token… can someone please tell me where i do this?

        sudou can run the auth_web.py script.
    Run the script: python auth_web.py
    Open a web browser and go to http://localhost:3000
    You should be redirected to an Amazon Login page. Enter your username and password and login.
    You should now see a simple page that says Success! and the refresh token value.
    Copy the refresh token value and set it in alexa_client/settings.py

    Thanks very much in advance

  • Module Developer

    Are you physically connected or VNC’ed to the raspberryPi? If so, open up a terminal window and then type
    sudo python /path/to/your/alexapi/folder/auth_web.py
    then open up your browser (the one in the pi) and go to http://localhost:3000
    log in with your Amazon login/pass. The script should update your settings.py file for you.

    If you are using an ssh program to access the pi. Run the first command as normal, then open up a browser and go to http://your.pi.ip.addr:3000

    The rest should be the same.

  • @mochman
    Perfect thanks… yeah i have access to Pi so will go try what you suggest in terminal and see how i get on. Unsure where the path is to enter but will try and find it.

  • pi@papaspi:~ $ sudo python /home/pi/MagicMirror/alexa-client/auth_web.py
    Traceback (most recent call last):
      File "/home/pi/MagicMirror/alexa-client/auth_web.py", line 5, in 
        import cherrypy
      File "/usr/local/lib/python2.7/dist-packages/cherrypy/__init__.py", line 66, in 
        from cherrypy._cperror import HTTPError, HTTPRedirect, InternalRedirect  # noqa: F401
      File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cperror.py", line 123, in 
        import six
    ImportError: No module named six
    pi@papaspi:~ $ 


    This site can’t be reached

    localhost refused to connect.
    Reloading the page
    Checking the connection
    Checking the proxy and the firewall

    Oh man… soooooo close I got a second wind there :-(

  • Module Developer

    Okay I thought you were using alexaPi, looks like alexa-client. In that case, have you run

    cd /home/pi/MagicMirror/alexa-client/
    pip install -r requirements.txt
    python setup.py install
    sudo pip install -r auth_web_requirements.txt

    already? If so, try

    cd /home/pi/MagicMirror/alexa-client/
    python auth_web.py

    In this application you will need to add the token you get from the website to your settings.py file. After you get the token, run nano settings.py and paste the token where it says


    so it will say something like

    REFRESH_TOKEN= `yourTokenGoesHere`

  • @mochman

    Thanks very much for pointing me in the right direction, much appreciated

  • This post is deleted!

  • This post is deleted!

  • This post is deleted!

  • This post is deleted!

Log in to reply

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.