Forums

stravalib

Hi

I'm working on a small project to look at Strava stats - using stravalib, which is the Strava-approved Python library for working with their API. All works fine on my home pc.

However, when i try to install it via a bash console on PythonAnywhere, I get this error - any idea what the problem is?

Thanks

13:20 ~ $ pip install stravalib Collecting stravalib Requirement already satisfied (use --upgrade to upgrade): pytz in /usr/local/lib/python2.7/dist-packages (from stravalib) Collecting arrow (from stravalib) Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from stravalib) Collecting units (from stravalib) Requirement already satisfied (use --upgrade to upgrade): requests<3.0dev,>=2.0 in /usr/local/lib/python2.7/dist -packages (from stravalib) Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packa ges (from arrow->stravalib) Installing collected packages: arrow, units, stravalib Exception: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run prefix=options.prefix_path, File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 742, in install **kwargs File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 831, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1032, in move_wheel_files isolated=self.isolated, File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 346, in move_wheel_files clobber(source, lib_dir, True) File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 317, in clobber ensure_dir(destdir) File "/usr/local/lib/python2.7/dist-packages/pip/utils/init.py", line 83, in ensure_dir os.makedirs(path) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/arrow-0.10.0.dist-info' 13:24 ~ $

Just worked this out - I need to specify Python3.6 - I resolved this by creating a virtual environment specifying Python3.6, then installed stravalib in that venv.

Glad you worked out a solution! There's a bit more detail explaining options for installing stuff on this help page