cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
965 stars 151 forks source link

Installing garminconnect without Rust? #163

Closed allanolesen closed 1 year ago

allanolesen commented 1 year ago

I am trying to install the garminconnect package in Carnets Plus on an iPad. (Carnets Plus is basically a Jupyter Notebook, and it is one of my few options of running Python on an iPad.)

The installation fails because garminconnect depends on pydantic_core, and apparently pydantic_core needs local compiling in Rust, which is not available in my very limited environment.

Is there a way around this?

This is the output from the installation process following %pip install garminconnect:


Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: garminconnect in /var/mobile/Containers/Data/Application/EB091EFB-AE1A-4C1F-88FD-80EBA19EC17D/Library/lib/python3.11/site-packages (0.2.8)
Requirement already satisfied: garth>=0.4.23 in /var/mobile/Containers/Data/Application/EB091EFB-AE1A-4C1F-88FD-80EBA19EC17D/Library/lib/python3.11/site-packages (from garminconnect) (0.4.34)
Requirement already satisfied: requests>=2.0.0 in /private/var/containers/Bundle/Application/FCA55D02-891B-495F-922B-D23BC524B21B/Carnets-sci.app/Library/lib/python3.11/site-packages (from garth>=0.4.23->garminconnect) (2.28.2)
Requirement already satisfied: pydantic>=1.10.13 in /var/mobile/Containers/Data/Application/EB091EFB-AE1A-4C1F-88FD-80EBA19EC17D/Library/lib/python3.11/site-packages (from garth>=0.4.23->garminconnect) (2.4.2)
Collecting requests-oauthlib>=1.3.1
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting annotated-types>=0.4.0
  Using cached annotated_types-0.5.0-py3-none-any.whl (11 kB)
Collecting pydantic-core==2.10.1
  Using cached pydantic_core-2.10.1.tar.gz (347 kB)
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'

  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      Checking for Rust toolchain....
      cargo: command not found

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/
matin commented 1 year ago

Garth supports Pydantic 1.

Here's how to ensure you're using a supported version of Pydantic in your environment: https://colab.research.google.com/gist/matin/0d33985a01701b18d99d4cfeaea08aa7/garth_with_pydantic1.ipynb

allanolesen commented 1 year ago

Thank you, it worked.