OpenXbox / xbox-smartglass-core-python

SmartGlass Core protocol python library
https://pypi.python.org/pypi/xbox-smartglass-core
MIT License
73 stars 13 forks source link

No module named xbox.sg #8

Closed foxriver76 closed 6 years ago

foxriver76 commented 6 years ago

When I try using the smartglass api, I receive an error "No module named xbox.sg".

It happens on command line and in the IDE (Spyder). The other imports are working well, e. g. xbox.webapi

I tried a lot of stuff, like explicity adding the lib to pythonPath, also tried installing via pip and via "python setup.py install".

Also when I use spyder and type "from xbox.sg.console import Console" and than click on sg or consle he opens the correct files.

So I dont really get what the error could be... is there any reason why this shouldn't work?

OS: Ubuntu 16.04 Python: 3.6

tuxuser commented 6 years ago

Can you shed some light and give exact commands on how you attempted to install the library, also please post the installation log (in code tags please).

Are you in the proper python environment when trying to import (you used a fresh virtual environment, right?)?

foxriver76 commented 6 years ago

When I use it in a fresh virtualEnv it seems to work properly. Is it only working in a virtual env? Yes, I was using the correct path, importing other modules e. g. from xbox.webapi worked fine as well.

Installation log via pip outside of the virtual env: (so nothing susp, I deleted the xbox-smartglass-core-1.0.8 xbox-webapi-1.1.3 files before the installation, thats why it installs them again)

pip install xbox-smartglass-core

Collecting xbox-smartglass-core
  Using cached https://files.pythonhosted.org/packages/6a/38/f25e50540376db38451beb2d30da605ccb7fa49a4093d8a4c53add34170c/xbox_smartglass_core-1.0.8-py2.py3-none-any.whl
Requirement already satisfied: construct==2.9.41 in ./anaconda3/lib/python3.6/site-packages/construct-2.9.41-py3.6.egg (from xbox-smartglass-core) (2.9.41)
Requirement already satisfied: appdirs==1.4.3 in ./anaconda3/lib/python3.6/site-packages/appdirs-1.4.3-py3.6.egg (from xbox-smartglass-core) (1.4.3)
Requirement already satisfied: urwid==2.0.1 in ./anaconda3/lib/python3.6/site-packages/urwid-2.0.1-py3.6-linux-x86_64.egg (from xbox-smartglass-core) (2.0.1)
Requirement already satisfied: dpkt==1.9.1 in ./anaconda3/lib/python3.6/site-packages/dpkt-1.9.1-py3.6.egg (from xbox-smartglass-core) (1.9.1)
Requirement already satisfied: cryptography==2.2.2 in ./anaconda3/lib/python3.6/site-packages (from xbox-smartglass-core) (2.2.2)
Collecting xbox-webapi>=1.1.2 (from xbox-smartglass-core)
  Using cached https://files.pythonhosted.org/packages/5c/0f/913a5ed01ff4679405f3554b7dfd4f8332a7436ddcab10280477d433d267/xbox_webapi-1.1.3-py2.py3-none-any.whl
Requirement already satisfied: gevent==1.2.2 in ./anaconda3/lib/python3.6/site-packages (from xbox-smartglass-core) (1.2.2)
Requirement already satisfied: asn1crypto>=0.21.0 in ./.local/lib/python3.6/site-packages (from cryptography==2.2.2->xbox-smartglass-core) (0.24.0)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in ./.local/lib/python3.6/site-packages (from cryptography==2.2.2->xbox-smartglass-core) (1.11.4)
Requirement already satisfied: six>=1.4.1 in ./.local/lib/python3.6/site-packages (from cryptography==2.2.2->xbox-smartglass-core) (1.11.0)
Requirement already satisfied: idna>=2.1 in ./.local/lib/python3.6/site-packages (from cryptography==2.2.2->xbox-smartglass-core) (2.6)
Requirement already satisfied: demjson in ./anaconda3/lib/python3.6/site-packages/demjson-2.2.4-py3.6.egg (from xbox-webapi>=1.1.2->xbox-smartglass-core) (2.2.4)
Requirement already satisfied: requests in ./.local/lib/python3.6/site-packages (from xbox-webapi>=1.1.2->xbox-smartglass-core) (2.18.4)
Requirement already satisfied: greenlet>=0.4.10 in ./anaconda3/lib/python3.6/site-packages (from gevent==1.2.2->xbox-smartglass-core) (0.4.12)
Requirement already satisfied: pycparser in ./.local/lib/python3.6/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography==2.2.2->xbox-smartglass-core) (2.18)
Requirement already satisfied: certifi>=2017.4.17 in ./.local/lib/python3.6/site-packages (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core) (2017.11.5)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.local/lib/python3.6/site-packages (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core) (3.0.4)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in ./.local/lib/python3.6/site-packages (from requests->xbox-webapi>=1.1.2->xbox-smartglass-core) (1.22)
Installing collected packages: xbox-webapi, xbox-smartglass-core
Successfully installed xbox-smartglass-core-1.0.8 xbox-webapi-1.1.3
tuxuser commented 6 years ago

Is it only working in a virtual env? No, but that's the cleanest approach, so it's highly recommended. You won't pollute your main python install and can easily set it up from scratch.

./anaconda3/lib/python3.6/ Maybe it's a problem with Anaconda 3 ? The whole xbox-* packages are namespace-packages ... Maybe Anaconda can't handle them?

Anyways, cool it's working for you now!

foxriver76 commented 6 years ago

Yes I also thought that it could be a spyder or conda problem, but I didn't found a specific issue.

Thanks for your help and for the framework.

tuxuser commented 6 years ago

It's a conda problem: https://github.com/conda-forge/staged-recipes/wiki/Namespace-packages