Skip to content

UserWarning: pkg_resources is deprecated as an API #597

Description

@j93hahn

I'm using fs==2.4.16 but whenever I import fs I get this error message:

/Users/jjahn/Desktop/Exa/monorepo/python/shared/exa_ml/.venv/lib/python3.10/site-packages/fs/__init__.py:4: 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. Refrain from using this package or pin to Setuptools<81.
  __import__("pkg_resources").declare_namespace(__name__)  # type: ignore

It's caused by this line:

__import__("pkg_resources").declare_namespace(__name__)  # type: ignore

Just move to PEP420 implicit namespace packaging (no __init__.py file at all) and it will resolve this error. But it should get fixed before 2025-11-30 or users may have problems

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