tcgoetz / GarminDB

Download and parse data from Garmin Connect or a Garmin watch, FitBit CSV, and MS Health CSV files into and analyze data in Sqlite serverless databases with Jupyter notebooks.
GNU General Public License v2.0
1.18k stars 142 forks source link

v3.0.1 pip installed #124

Closed EmptySoft closed 3 years ago

EmptySoft commented 3 years ago

I installed v3.0.1 via pip (on a linux machine), when i try to run

garmindb_cli.py --all --download --import --analyze

i got

harald@kalymnos:~/GarminDB.old> garmindb_cli.py --all --download --import --analyze ___Downloading All Data___ Geting activities: '/home/harald/HealthData/FitFiles/Activities' (1000) temp /tmp/tmpl7q07ddu 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 29211.09activities/s] Traceback (most recent call last): File "/home/harald/.local/bin/garmindb_cli.py", line 349, in <module> main(sys.argv[1:]) File "/home/harald/.local/bin/garmindb_cli.py", line 330, in main download_data(args.overwrite, args.latest, args.stats) File "/home/harald/.local/bin/garmindb_cli.py", line 126, in download_data date, days = __get_date_and_days(MonitoringDb(db_params_dict), latest, MonitoringHeartRate, MonitoringHeartRate.heart_rate, 'monitoring') File "/home/harald/.local/lib/python3.6/site-packages/idbutils/db.py", line 63, in __init__ self.attributes.version_check(self, self.db_version) File "/home/harald/.local/lib/python3.6/site-packages/idbutils/db_attributes.py", line 24, in version_check self.version = self.__version_check_key(db, self.__db_version_key, version_number) File "/home/harald/.local/lib/python3.6/site-packages/idbutils/db_attributes.py", line 19, in __version_check_key cls.set_if_unset(db, version_key, version_number) File "/home/harald/.local/lib/python3.6/site-packages/idbutils/key_value.py", line 46, in set_if_unset return cls.find_or_create(db, {'timestamp' : timestamp, 'key' : key, 'value' : str(value)}) File "/home/harald/.local/lib/python3.6/site-packages/idbutils/db_object.py", line 294, in find_or_create with db.managed_session() as session: File "/home/harald/.local/lib/python3.6/site-packages/idbutils/db.py", line 104, in managed_session return sessionmaker(self.engine, expire_on_commit=False).begin() AttributeError: 'sessionmaker' object has no attribute 'begin'

for the bugreport, bugreport.sh is not aviable

tcgoetz commented 3 years ago

I think this is your version of SQLAlchemy is out of date. What does pip freeze | grep SQLAlchemy return?

I have: SQLAlchemy==1.4.18.

I can set the minimum version required for GarminDB if that's it. You can upgrade you SQLAlchemy to the latest with pip install --upgrade SQLAlchemy.

I have a To Do to add bugreport.sh to the module as data file.

EmptySoft commented 3 years ago

Hi Tom.!

Thanks for your replay.

harald@kalymnos:~> pip freeze | grep SQLAlchemy SQLAlchemy==1.3.23

i do a pip install SQLAlchemy --upgrade after them i have SQLAlchemy==1.4.20

after them a pip install --upgrade garmindb now i cannot find garmindb_cli.py

tcgoetz commented 3 years ago

after them a pip install --upgrade garmindb now i cannot find garmindb_cli.py

If garmindb_cli.py after pip install --upgrade garmindb then that command must have failed. What was the output of that command?

EmptySoft commented 3 years ago

after them a pip install --upgrade garmindb now i cannot find garmindb_cli.py If garmindb_cli.py after pip install --upgrade garmindb then that command must have failed. What was the output of that command?

harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb> garmindb_cli.py --all --download --import --analyze garmindb_cli.py: Befehl nicht gefunden

harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb> find -iname garmindb_cli.py harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb>

harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb> ll insgesamt 228 -rw-r--r-- 1 harald users 16791 30. Jun 04:35 activity_fit_file_processor.py -rw-r--r-- 1 harald users 19910 30. Jun 04:35 analyze.py -rw-r--r-- 1 harald users 10298 30. Jun 04:35 config_manager.py -rw-r--r-- 1 harald users 1723 30. Jun 04:35 config.py -rw-r--r-- 1 harald users 2613 30. Jun 04:35 copy.py -rw-r--r-- 1 harald users 17687 30. Jun 04:35 download.py -rw-r--r-- 1 harald users 2486 30. Jun 04:35 export_activities.py drwxr-xr-x 3 harald users 127 30. Jun 04:35 fitbitdb -rw-r--r-- 1 harald users 2276 30. Jun 04:35 fit_data.py -rw-r--r-- 1 harald users 12116 30. Jun 04:35 fit_file_processor.py -rw-r--r-- 1 harald users 1027 30. Jun 04:35 GarminConnectConfig.json.example -rw-r--r-- 1 harald users 3946 30. Jun 04:35 garmin_connect_config_manager.py -rw-r--r-- 1 harald users 13883 30. Jun 04:35 garmin_connect_enums.py drwxr-xr-x 3 harald users 168 30. Jun 04:35 garmindb -rw-r--r-- 1 harald users 10235 30. Jun 04:35 graphs.py -rw-r--r-- 1 harald users 25336 30. Jun 04:35 import_activities.py -rw-r--r-- 1 harald users 15092 30. Jun 04:35 import_monitoring.py -rw-r--r-- 1 harald users 1317 30. Jun 04:35 __init__.py -rw-r--r-- 1 harald users 5550 30. Jun 04:35 monitoring_fit_file_processor.py drwxr-xr-x 3 harald users 129 30. Jun 04:35 mshealthdb -rw-r--r-- 1 harald users 544 30. Jun 04:35 open_with_basecamp.py -rw-r--r-- 1 harald users 546 30. Jun 04:35 open_with_google_earth.py -rw-r--r-- 1 harald users 1059 30. Jun 04:35 plugin_manager.py drwxr-xr-x 2 harald users 4096 30. Jun 04:35 __pycache__ -rw-r--r-- 1 harald users 640 30. Jun 04:35 statistics.py drwxr-xr-x 3 harald users 108 30. Jun 04:35 summarydb -rw-r--r-- 1 harald users 4868 30. Jun 04:35 tcx.py -rw-r--r-- 1 harald users 367 30. Jun 04:35 version_info.py -rw-r--r-- 1 harald users 707 30. Jun 04:35 version.py harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb>

harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb/garmindb> ll insgesamt 60 -rw-r--r-- 1 harald users 18869 30. Jun 04:35 activities_db.py -rw-r--r-- 1 harald users 19033 30. Jun 04:35 garmin_db.py -rw-r--r-- 1 harald users 3285 30. Jun 04:35 garmin_summary_db.py -rw-r--r-- 1 harald users 779 30. Jun 04:35 __init__.py -rw-r--r-- 1 harald users 11754 30. Jun 04:35 monitoring_db.py drwxr-xr-x 2 harald users 205 30. Jun 04:35 __pycache__ harald@kalymnos:~/.local/lib/python3.6/site-packages/garmindb/garmindb>

tcgoetz commented 3 years ago

Assuming that .local is your virtual environment, then garmindb_cli.py should be in ~/.local/bin

Here's mine:

(.venv) orion-dock:GarminDB_develop tgoetz$ which garmindb_cli.py
/Users/tgoetz/Projects/GarminDB_develop/.venv/bin/garmindb_cli.py

If your virtual environment is activated, the ~/.local/bin should be in your path.

EmptySoft commented 3 years ago

Thanks a lot, now it works