OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
175 stars 44 forks source link

Can't Run Sample #47

Closed bsled96 closed 3 years ago

bsled96 commented 3 years ago

Hey there, I've been messing around with this for the past few days. I can't seem to figure out how to use this at all. The sample code provided leaves me with a 'async with' outside async function.

I tried to put into an async function and I get a whole array of other errors when I try to fix various things until I eventually hit a wall.

The main thing that seems problematic when I put it inside an async function is this line does not work: from xbox.webapi.authentication.models import OAuth2TokenResponse

I've successfully authenticated, and I'm able to run the command line tool to search for games, but I've been unsuccessful in trying to run any Python code to pull information.

I'm a bit new to async functions in Python so maybe it's just something I'm not understanding about how they work or something. Any help is appreciated. Thanks.

bsled96 commented 3 years ago

Not really sure what happened but I did a fresh install of Python and the api and it's working fine now. Seems like something went wrong with my initial install through pip.