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

errors Stopping xbox-rest-server from running #34

Open
shadow05139 opened this issue Mar 8, 2019 · 9 comments
Open

errors Stopping xbox-rest-server from running #34

shadow05139 opened this issue Mar 8, 2019 · 9 comments

Comments

@shadow05139
Copy link

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
Copy link
Contributor

tuxuser commented Mar 8, 2019

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
Copy link
Author

ok cool thanks for that will do that thnx :)

@shadow05139
Copy link
Author

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
Copy link
Contributor

tuxuser commented Mar 9, 2019

Normally that should not happen...

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

@shadow05139
Copy link
Author

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
Copy link
Contributor

tuxuser commented Mar 9, 2019

Oops, its pip install xbox-smartglass-rest

@shadow05139
Copy link
Author

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
Copy link
Contributor

tuxuser commented Mar 10, 2019

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
Copy link
Author

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

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