25

I get this warning when I run pipenv --version and related commands.

/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(
pipenv, version 2022.5.2
scribe
  • 670
  • 7
  • 14
rekxspein
  • 363
  • 1
  • 3
  • 8

4 Answers4

35

A bug in setuptools seems to be causing this. There is also some discussion about this on the pipenv's Github repository. People at those two places are giving different work-arounds. The only one that worked for me was,

pip install --upgrade --user setuptools==58.3.0

Note this is actually a downgrade. Now pipenv --version runs without warnings.

scribe
  • 670
  • 7
  • 14
1

This worked for me on Ubuntu 22.04:

pip install --upgrade pipenv

Source: This GitHub comment on the pipenv repository issue linked by @scribe in his answer.

leeoocca
  • 11
  • 1
0

Run pip list and look for packages with the corresponding versions with errors, in your case:

  • 1.16.0-unknown
  • 0.1.43ubuntu1
  • 1.1build1

Upgrade the corresponding packages to newer versions, for example: pip install --upgrade <pkg_name>

The error messages should go away after that.

0

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