hunterjm / hassio-addons

Control your Xbox One from your Home Assistant device.
MIT License
55 stars 50 forks source link

errors Stopping xbox-rest-server from running #34

Open shadow05139 opened 5 years ago

shadow05139 commented 5 years ago

this is my output running on my Stretch hassbain running HA vr0.89.1

Traceback (most recent call last): File "/usr/local/bin/xbox-rest-server", line 7, in from xbox.rest.scripts.rest_server import main File "/usr/local/lib/python2.7/dist-packages/xbox/rest/scripts/rest_server.py", line 9, in from xbox.rest.app import app File "/home/pi/.local/lib/python2.7/site-packages/gevent/builtins.py", line 96, in import result = _import(*args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/xbox/rest/app.py", line 2, in from http import HTTPStatus File "/home/pi/.local/lib/python2.7/site-packages/gevent/builtins.py", line 96, in import result = _import(args, **kwargs) ImportError: No module named http

tuxuser commented 5 years ago

You are not located within a python 3 virtualenv! (You can see that on the python2.7 string)

Here a suggestion how to deal with it:

  1. Change to homeassistant user sudo -u homeassistant -H -s
  2. Create a new directory for the xbox virtual environment mkdir /srv/homeassistant/xbox-venv
  3. Create the new environment python3 -m venv /srv/homeassistant/xbox-venv
  4. Activate the environment /srv/homeassistant/xbox-venv/bin/activate
  5. Install xbox-rest-server pip install xbox-rest-server
  6. Start it xbox-rest-server

PS: You can of course create an entirely new user to just serve the xbox rest server PPS: To start it as a service automatically, see README

shadow05139 commented 5 years ago

ok cool thanks for that will do that thnx :)

shadow05139 commented 5 years ago

Im now snagged on 4. homeassistant@hassbian:/home/pi $ /srv/homeassistant/xbox-venv/bin/activate bash: /srv/homeassistant/xbox-venv/bin/activate: Permission denied

tuxuser commented 5 years ago

Normally that should not happen...

chmod +x /srv/homeassistant/xbox-venv/bin/activate

shadow05139 commented 5 years ago

got that sorted but now bun now pip wont install xbox-rest-server

homeassistant@hassbian:/home/pi $ pip install xbox-rest-server Collecting xbox-rest-server Could not find a version that satisfies the requirement xbox-rest-server (from versions: ) No matching distribution found for xbox-rest-server

tuxuser commented 5 years ago

Oops, its pip install xbox-smartglass-rest

shadow05139 commented 5 years ago

oh ok all good that's now put me right back at the start now with the same error within this env now :-/

homeassistant@hassbian:/home/pi $ xbox-rest-server Traceback (most recent call last): File "/usr/local/bin/xbox-rest-server", line 7, in from xbox.rest.scripts.rest_server import main File "/home/homeassistant/.local/lib/python2.7/site-packages/xbox/rest/scripts/rest_server.py", line 9, in from xbox.rest.app import app File "/home/homeassistant/.local/lib/python2.7/site-packages/gevent/builtins.py", line 96, in import result = _import(*args, *kwargs) File "/home/homeassistant/.local/lib/python2.7/site-packages/xbox/rest/app.py", line 2, in from http import HTTPStatus File "/home/homeassistant/.local/lib/python2.7/site-packages/gevent/builtins.py", line 96, in import result = _import(args, **kwargs) ImportError: No module named http

tuxuser commented 5 years ago

You are either NOT YET in the python 3 virtual env - or not anymore, after installation. You have to stay in the python 3 context to execute it....

shadow05139 commented 5 years ago

alright got that all sorted was loading from installs outside the env fixed by running pip uninstall xbox-smartglass-rest as pi almost got it working but starting it returns command not found?

homeassistant@hassbian:/home/pi $ xbox-smartglass-rest bash: xbox-smartglass-rest: command not found