Skip to content

deprecation warning related to the google namespace package #2640

@kadeschs

Description

@kadeschs

Environment details

  • OS type and version: Home Assistant container (Docker on Synology NAS)
  • Python version: 3.13
  • google-api-python-client version: 2.71.0
  • Installed via: pip (inside container)

Problem description

When running Home Assistant on Python 3.13, I encountered a deprecation warning related to the google namespace package: /usr/local/lib/python3.13/site-packages/google/init.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html.. The pkg_resources package is slated for removal as early as 2025-11-30. import('pkg_resources').declare_namespace(name).

Suggested fix

Consider migrating to pkgutil or importlib for namespace declaration, as pkg_resources is deprecated and scheduled for removal in future Python versions.

Steps to reproduce

  1. Run Home Assistant 2025.8 in a Docker container using Python 3.13.
  2. Observe logs at startup for py.warnings related to pkg_resources.

Code example

import homeassistant.components.cast

Stack trace

/usr/local/lib/python3.13/site-packages/google/init.py:2: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30.
import('pkg_resources').declare_namespace(name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions