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

distutils not found #207

Closed Hblust closed 9 months ago

Hblust commented 1 year ago

Describe the bug Install of GarminDB fails while looking for module named distutils

To Reproduce Steps to reproduce the behavior:

  1. pip -m pip install GarminDB on either Python 3.12 or 3.13.0a1
  2. import distutils.coreq ModuleNotFoundError: No module named 'distutils' [end of output]

Expected behavior expected complete install of GarminDB. Looks like GarminDB requires the now deprecated 'distutils' versus the newer setuptools

Logs Please include a copy of screen logging and garmin.log.

Please run bugreport.sh and attach bugreport.zip.

Additional context Add any other context about the problem here.

tcgoetz commented 1 year ago

I need more info. distutils is not in the product or dev requirements.txt files and is also not in my build environment:

Screenshot 2023-10-28 at 1 57 13 PM

Can you give more context on where the import line is coming from?

Hblust commented 1 year ago

NP, here's the full output from running 'pip install GarminDB. Please forgive any unforced rookie errors.

`C:\Users\hblust>pip install garminDB Defaulting to user installation because normal site-packages is not writeable Collecting garminDB Using cached garmindb-3.5.0-py3-none-any.whl.metadata (7.5 kB) Collecting SQLAlchemy==2.0.19 (from garminDB) Using cached SQLAlchemy-2.0.19-py3-none-any.whl.metadata (9.4 kB) Collecting requests==2.31.0 (from garminDB) Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB) Requirement already satisfied: python-dateutil==2.8.2 in c:\users\hblust\appdata\roaming\python\python313\site-packages (from garminDB) (2.8.2) Collecting cached-property==1.5.2 (from garminDB) Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB) Collecting tqdm==4.65.1 (from garminDB) Using cached tqdm-4.65.1-py3-none-any.whl.metadata (56 kB) Collecting matplotlib==3.7.2 (from garminDB) Using cached matplotlib-3.7.2.tar.gz (38.1 MB) Installing build dependencies ... error error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 2 ╰─> [115 lines of output] Collecting certifi>=2020.06.20 Using cached certifi-2023.7.22-py3-none-any.whl.metadata (2.2 kB) Collecting oldest-supported-numpy Using cached oldest_supported_numpy-2023.10.25-py3-none-any.whl.metadata (9.8 kB) Collecting pybind11>=2.6 Using cached pybind11-2.11.1-py3-none-any.whl.metadata (9.5 kB) Collecting setuptools>=42 Using cached setuptools-68.2.2-py3-none-any.whl.metadata (6.3 kB) Collecting setuptools_scm>=7 Using cached setuptools_scm-8.0.4-py3-none-any.whl.metadata (6.4 kB) Collecting numpy (from oldest-supported-numpy) Using cached numpy-1.25.2.tar.gz (10.8 MB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' ERROR: Exception: Traceback (most recent call last): File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\cli\base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) ^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\cli\req_command.py", line 245, in wrapper return func(self, options, args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\commands\install.py", line 377, in run requirement_set = resolver.resolve( ^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 95, in resolve result = self._result = resolver.resolve( ^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\resolvers.py", line 546, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\resolvers.py", line 427, in resolve failure_causes = self._attempt_to_pin_criterion(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\resolvers.py", line 239, in _attempt_to_pin_criterion criteria = self._get_updated_criteria(candidate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\resolvers.py", line 230, in _get_updated_criteria self._add_to_criteria(criteria, requirement, parent=candidate) File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria if not criterion.candidates: ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\resolvelib\structs.py", line 156, in bool return bool(self._sequence) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 155, in bool return any(self) ^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 143, in return (c for c in iterator if id(c) not in self._incompatible_ids) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built candidate = func() ^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\factory.py", line 211, in _make_candidate_from_link self._link_candidate_cache[link] = LinkCandidate( ^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 293, in init super().init( File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 156, in init self.dist = self._prepare() ^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 225, in _prepare dist = self._prepare_distribution() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\resolution\resolvelib\candidates.py", line 304, in _prepare_distribution return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\operations\prepare.py", line 525, in prepare_linked_requirement return self._prepare_linked_requirement(req, parallel_builds) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\operations\prepare.py", line 640, in _prepare_linked_requirement dist = _get_prepared_distribution( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\operations\prepare.py", line 71, in _get_prepared_distribution abstract_dist.prepare_distribution_metadata( File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\distributions\sdist.py", line 54, in prepare_distribution_metadata self._install_build_reqs(finder) File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\distributions\sdist.py", line 124, in _install_build_reqs build_reqs = self._get_build_requires_wheel() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\distributions\sdist.py", line 101, in _get_build_requires_wheel return backend.get_requires_for_build_wheel() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_internal\utils\misc.py", line 751, in get_requires_for_build_wheel return super().get_requires_for_build_wheel(config_settings=cs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\pyproject_hooks_impl.py", line 166, in get_requires_for_build_wheel return self._call_hook('get_requires_for_build_wheel', { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\pyproject_hooks_impl.py", line 321, in _call_hook raise BackendUnavailable(data.get('traceback', '')) pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last): File "C:\Users\hblust\AppData\Roaming\Python\Python313\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in _build_backend obj = import_module(mod_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python313\Lib\importlib__init.py", line 88, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1304, in _find_and_load_unlocked File "", line 488, in _call_with_frames_removed File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 1008, in exec_module File "", line 488, in _call_with_frames_removed File "C:\Users\hblust\AppData\Local\Temp\pip-build-env-sklpzxnf\overlay\Lib\site-packages\setuptools\init__.py", line 10, in import distutils.core ModuleNotFoundError: No module named 'distutils'

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 2 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

tcgoetz commented 1 year ago

Ok, so GarminDb pins matplotlib==3.7.2 which requires numpy-1.25.2.tar.gz. On your system matplotlib==3.7.2 requires distutils.core, but not on my system. I don't have an immediate answer on why this is happening. Can you run GarminDb in a virtual environment (venv) with 3.11? GarminDb is currently tested with 3.11.

tcgoetz commented 1 year ago

Please retry with 3.5.1+. The main package no longer has a dependency on matplotlib.