You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UserWarning: pkg_resources is deprecated as an API #597
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
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
Doesn't the error also reference pinning setup-tools to a specific version? I fixed by pinning setup-tools to 80.4.0. You may have the more appropriate fix but I would have thought somewhere around here would have been the fix.
Could we please get this fixed in a new release soon? That would give other projects time to update their dependencies to prevent breakage in two months... At this point it's clear to me that this project is unmaintained, but if the maintainers don't even merge small pull requests anymore then please communicate that to signal that people should move away from this project.
Reacted by milahu, Vincent Neubauer, Anton Melser, Eigi Eigendorf and jacobg
Could we please get this fixed in a new release soon?
can you please switch to a package manager
that lets you build and install packages also from github, not just from pypi?
example: fs.nix based on #590 (comment)
or add some pyfilesystem2 branch as a gitmodule to your project
but waiting for nonexistant maintainers to fix some pypi release is... a waste of time
My package manager can handle git dependencies just fine, but if I publish my library to pypi with a git dependency, some my users are bound to run into issues. I just want to avoid the additional support burden, so a PyPi release would be a much nicer solution 🙂
I'm looking for an in-memory filesystem provider, and unfortunately PyFilesystem appears to be pretty unique when it comes to that. On second thought however, I could probably use the builtin tarfile module with a bytesio object to accomplish that...
Oh nice! It's insane how difficult it is to find things through google nowadays...
That MemoryFS limitation is a bummer though, and unfortunately a dealbreaker I'm afraid... I see you've already started a PR to change that, but I don't think I have the time to continue that effort right now. For now I think (hope) I can make it work with tarfile
Since #590 hasn't been merged or released, I published it: fitzyracing-fs 2.4.17 on PyPI is 2.4.16 plus eli-schwartz's #590 and #589, so import fs no longer touches pkg_resources, with no warning on setuptools <82 and no ModuleNotFoundError on 82+. fs.* extensions and opener plugins are still found. Same fs import name; uninstall the original first: pip uninstall -y fs && pip install fitzyracing-fs. Details: https://github.com/fitzyracing1/pyfilesystem2
Activity
javitab commentedon Jul 29, 2025
Doesn't the error also reference pinning setup-tools to a specific version? I fixed by pinning setup-tools to 80.4.0. You may have the more appropriate fix but I would have thought somewhere around here would have been the fix.
milahu commentedon Jul 30, 2025
duplicate of #577
fixed by #590
cadmi commentedon Aug 6, 2025
When is the release?
eli-schwartz commentedon Aug 27, 2025
First my PRs to fix this would need to be merged by a maintainer.
Remove PyFilesystem2 dependency
Remove PyFilesystem2 dependency
malmeloo commentedon Sep 15, 2025
Could we please get this fixed in a new release soon? That would give other projects time to update their dependencies to prevent breakage in two months... At this point it's clear to me that this project is unmaintained, but if the maintainers don't even merge small pull requests anymore then please communicate that to signal that people should move away from this project.
milahu commentedon Sep 15, 2025
can you please switch to a package manager
that lets you build and install packages also from github, not just from pypi?
example: fs.nix based on #590 (comment)
or add some
pyfilesystem2branch as a gitmodule to your projectbut waiting for nonexistant maintainers to fix some pypi release is... a waste of time
malmeloo commentedon Sep 15, 2025
My package manager can handle git dependencies just fine, but if I publish my library to pypi with a git dependency, some my users are bound to run into issues. I just want to avoid the additional support burden, so a PyPi release would be a much nicer solution 🙂
I'm looking for an in-memory filesystem provider, and unfortunately PyFilesystem appears to be pretty unique when it comes to that. On second thought however, I could probably use the builtin tarfile module with a bytesio object to accomplish that...
milahu commentedon Sep 15, 2025
fsspec memory? (fsspec/filesystem_spec#1904)
malmeloo commentedon Sep 15, 2025
Oh nice! It's insane how difficult it is to find things through google nowadays...
That MemoryFS limitation is a bummer though, and unfortunately a dealbreaker I'm afraid... I see you've already started a PR to change that, but I don't think I have the time to continue that effort right now. For now I think (hope) I can make it work with
tarfileSuppress pkg_resources deprecation warning from fs package
rerowep commentedon Feb 9, 2026
This module is not working any more with setuptools version 82 https://github.com/pypa/setuptools/tree/v82.0.0!
cmruffin commentedon Feb 9, 2026
setuptools 81 can be used until a patch is made.
eli-schwartz commentedon Feb 9, 2026
As I've noted earlier:
I have a series of PRs that fix this, no patch need be written.
Also, this PR is a duplicate. @j93hahn simply didn't close it upon being informed of such.
Please keep all discussion in the original ticket (#577). Thanks.
Remove PyFilesystem2 dependency
Remove PyFilesystem2 dependency @W-21244194 (#3923)
fitzyracing1 commentedon Oct 8, 2026
Since #590 hasn't been merged or released, I published it:
fitzyracing-fs2.4.17 on PyPI is 2.4.16 plus eli-schwartz's #590 and #589, soimport fsno longer touchespkg_resources, with no warning on setuptools <82 and noModuleNotFoundErroron 82+.fs.*extensions and opener plugins are still found. Samefsimport name; uninstall the original first:pip uninstall -y fs && pip install fitzyracing-fs. Details: https://github.com/fitzyracing1/pyfilesystem2