Forum Archive

Stravalib access through Pythonista

jbarriga

Hi everyone!
First post here. I am trying to access the Strava API on Pythonista. I downloaded Stash and installed the stravalib library. However, when I try to run the authentication code (or any of the code in the examples in the stravalib folder) I get the following error: "No module named 'arrow'". I am a bit confused as none of the these commands have an 'arrow' module. Thank you in advance for any help!

from stravalib import Client
client = Client()
url = client.authorization_url(client_id=MY_STRAVA_CLIENT_ID,
redirect_uri='http://127.0.0.1:5000/authorization')

from stravalib import Client
code = request.args.get('code') # e.g.
client = Client()
access_token = client.exchange_code_for_token(client_id=MY_STRAVA_CLIENT_ID,
client_secret=MY_STRAVA_CLIENT_SECRET,
code=code)

Best,
Jorge

ccc

In StaSH, try to pip install arrow and then try some of the arrow examples at https://pypi.python.org/pypi/arrow

JonB

The setup for stravalib is not compatible with stash pip, for some reason. Using wget to download and tar -xzf to untar, checking requirements.txt shows we need arrow,units, and pytz.

So
pip install arrow
pip install units
pip install pytz

should do it

jbarriga

Thanks a lot!