Mycodo Install Failed

I have tried to re-install Mycodo on a Raspberry Pi 4B 64-bit (influx V2).

Unfortunately, I have encountered an error and I have failed to find a solution.

The install failed at:

pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import ‘setuptools.build_meta’

I cannot login to Mycodo.

Here is the install error:

Collecting MarkupSafe==2.1.3 (from -r /opt/Mycodo/install/requirements.txt (line 26))
  Downloading MarkupSafe-2.1.3.tar.gz (19 kB)
  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 "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper
    status = _inner_run()
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
    return self.run(options, args)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/cli/req_command.py", line 85, in wrapper
    return func(self, options, args)
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/commands/install.py", line 388, in run
    requirement_set = resolver.resolve(
        reqs, check_supported_wheels=not options.target_dir
    )
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 99, in resolve
    result = self._result = resolver.resolve(
                            ~~~~~~~~~~~~~~~~^
        collected.requirements, max_rounds=limit_how_complex_resolution_can_be
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 601, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 434, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py", line 150, in _add_to_criteria
    if not criterion.candidates:
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/resolvelib/structs.py", line 194, in __bool__
    return bool(self._sequence)
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 165, in __bool__
    self._bool = any(self)
                 ~~~^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 149, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
                       ^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 39, in _iter_built
    candidate = func()
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 180, in _make_candidate_from_link
    base: BaseCandidate | None = self._make_base_candidate_from_link(
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        link, template, name, version
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 226, in _make_base_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
                                       ~~~~~~~~~~~~~^
        link,
        ^^^^^
    ...<3 lines>...
        version=version,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 318, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        link=link,
        ^^^^^^^^^^
    ...<4 lines>...
        version=version,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 161, in __init__
    self.dist = self._prepare()
                ~~~~~~~~~~~~~^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 238, in _prepare
    dist = self._prepare_distribution()
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 329, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 543, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 658, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
        req,
    ...<3 lines>...
        self.check_build_deps,
    )
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 77, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        build_env_installer, build_isolation, check_build_deps
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/distributions/sdist.py", line 55, in prepare_distribution_metadata
    self._install_build_reqs(build_env_installer)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/distributions/sdist.py", line 132, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/distributions/sdist.py", line 107, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_internal/utils/misc.py", line 694, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 196, in get_requires_for_build_wheel
    return self._call_hook(
           ~~~~~~~~~~~~~~~^
        "get_requires_for_build_wheel", {"config_settings": config_settings}
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/Mycodo/env/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
    ...<4 lines>...
    )
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'
Collecting testfixtures==7.0.2 (from -r /opt/Mycodo/install/requirements-testing.txt (line 2))
  Downloading testfixtures-7.0.2-py3-none-any.whl.metadata (3.4 kB)
Collecting mock==4.0.3 (from -r /opt/Mycodo/install/requirements-testing.txt (line 3))
  Downloading mock-4.0.3-py3-none-any.whl.metadata (2.8 kB)

How can I fix this?

What operating system are you using? It seems you’re using Python 3.13, which is very new, and likely the source of the incompatibility.

I followed the instructions on the Mycodo installation here. It appears that Raspberry Pi installs Python v3.13 by default.

How do I instruct Raspberry Pi to install the desired version of Python during the install?

That doesn’t answer what operating system you installed. Raspberry Pi OS Bookworm has Python 3.11. If you have 3.13, it indicates you didn’t install Bookworm that’s listed in the instructions.