6

I am running Ubuntu 20.04 in WSLg under a Windows 11 insider build (build 22523). When I do certain Python-related things, I keep getting these two warnings:

/home/eafpres/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
/home/eafpres/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(

For example, I just did: pip install plotly

and got these, but the install worked fine. Similarly, I get them when I start my IDE (Spyder).

Is there something wrong with my Ubuntu install?

Kevin Bowen
  • 19,395
  • 55
  • 76
  • 81
eafpres
  • 71
  • 1
  • 1
  • 4
  • 1
    Anything in `/home/$USER/.local/` was installed by you manually (apt and snap packages won't install there) and has nothing to do with the functioning of your Ubuntu install. Whatever the problem is, it's not an Ubuntu *system* problem. It's a problem with the version of Python that you manually installed. – user535733 Dec 23 '21 at 20:57
  • 1
    Thanks. I can see that is probably set up by pip, and somewhere installing packages it caused this issue. I haven't been able to find the specific package yet, but this helps. – eafpres Dec 24 '21 at 00:16
  • 3
    Does this answer your question? [What is the meaning of this PkgResourcesDeprecationWarning warning from pipenv --version?](https://askubuntu.com/questions/1406952/what-is-the-meaning-of-this-pkgresourcesdeprecationwarning-warning-from-pipenv) – Pablo Bianchi Jun 15 '22 at 20:40

3 Answers3

2

Rename the .local/lib/python3.8/site-packages/pkg_resources folder to pkg_resources_back. After that, all warnings should be gone.

pip list should also work, but you need check if other things work as well.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Michał
  • 21
  • 3
1

This module is installed as part of setuptools. You can uninstall setuptools to remove this package if you don't need it.

It is very possible that there is another setuptools from the Ubuntu repo installed in your system (it is version 45.2 in Ubuntu 20.04 currently). You can confirm that by running:

apt list | grep setuptools

If not, you may install this setuptools instead, which should be more compatible with your Ubuntu system, if that outdated version fits you.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Wei
  • 11
  • 1
0

You are not doing anything wrong. These warnings are caused by not PEP 440 compliant versions of those Python packages. These Ubuntu package versions need to be fixed: https://launchpad.net/bugs/1991606

Benjamin Drung
  • 163
  • 1
  • 8