pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

Invalid version and will not be supported in a future release

Open kaykhan opened this issue 3 years ago • 4 comments

When i run pipenv shell i get the following warning/error?

pipenv shell

/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(
/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(
Loading .env environment variables.

python --version
Python 3.10.4

OS Ubuntu 22.04

kaykhan avatar Jul 29 '22 09:07 kaykhan

@kaykhan This issue has been reported from time to time, but unfortunately it is really challenging to figure out where pipenv could be invoking this from. Could you try the main branch of pipenv pip install git+https://github.com/pypa/pipenv.git@main and see if the error is still present?

matteius avatar Aug 11 '22 06:08 matteius

@matteius im using pipenv, version 2022.7.24 which was released recently - https://github.com/pypa/pipenv/releases/tag/v2022.7.24

Still get the same error

is there anything else i can do to help debug?


Just looking into this further i came across another post -- apparently its an issue with "setuptools"?

https://askubuntu.com/questions/1406952/what-is-the-meaning-of-this-pkgresourcesdeprecationwarning-warning-from-pipenv

Ive not had a chance to apply the solution (downgrade) to test if that is it

Although the actual github thread the op suggest this problem does not occur in version 59. https://github.com/pypa/setuptools/issues/3278 - but in my case it does, but not sure if its the same issue or related.

pip list | grep "setuptools"                                                                                                                                                                      
setuptools              59.6.0

kaykhan avatar Aug 12 '22 07:08 kaykhan

Downgrading setuptools really should not be the answer. It's just a warning, you can ignore it for now until it can be figured out.

matteius avatar Aug 12 '22 13:08 matteius

Downgrading setuptools really should not be the answer. It's just a warning, you can ignore it for now until it can be figured out.

Okay thank you, i will check back at a later date and if theres anyting else i can do/try to help let me know!

kaykhan avatar Aug 12 '22 15:08 kaykhan

@kaykhan I would be curious to know, if you still get the error with pipenv==2022.8.24?

matteius avatar Aug 25 '22 01:08 matteius

@matteius Upgraded pipenv for you, unfortunately i still get these errors/warnings

1. pipenv --version

/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(
/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(
pipenv, version 2022.8.15

2. pip install --upgrade pipenv

3. pipenv --version


/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(
/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(
pipenv, version 2022.8.24

kaykhan avatar Aug 25 '22 07:08 kaykhan

The warning will show up even when entering the following:

$ pipenv help
/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 1.13.1-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
/home/user/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
Usage: pipenv [OPTIONS] COMMAND [ARGS]...
Try 'pipenv -h' for help.

Error: No such command 'help'.

Did you mean one of these?
    shell

This means that the problem lies before or while parsing the cmd arguments.

real-yfprojects avatar Aug 27 '22 18:08 real-yfprojects

I am using WSL2 Ubuntu 18.04

By just checking the version, I also get this error:

$ pipenv --version
/home/sep/.local/lib/python3.6/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
  PkgResourcesDeprecationWarning,
pipenv, version 2022.4.20

sepsallao avatar Sep 01 '22 15:09 sepsallao

2022.9.20 is released

matteius avatar Sep 20 '22 18:09 matteius

Upgrading to this new version (2022.9.20) has resolved the problem for me. thanks!

Screenshot from 2022-09-21 12-46-59

kaykhan avatar Sep 21 '22 11:09 kaykhan

I have just come across this issue mentioned by @kaykhan previously but for me, the issue is appearing on GitHub when I was trying to run a job.

Screenshot 2023-01-16 at 3 31 57 AM

I have also tried including the "pip install git+https://github.com/pypa/pipenv.git@main" on the main branch (suggested by @matteius ) but unfortunately, I still face the same issue 😭

Screenshot 2023-01-16 at 3 34 24 AM

Hope to know if anyone knows how to resolve this? 🙏🏻

fatraphael95 avatar Jan 15 '23 19:01 fatraphael95

@fatraphael95 that fix was released to pypi a while ago. Is it possible you are invoking pipenv from an apt installed version?

matteius avatar Jan 16 '23 06:01 matteius

Hi @matteius, sorry I'm quite new to this and not quite sure what you mean by invoking pipenv from an apt installed version. Currently, I have sort of resolved the earlier issue by changing from setuptools==65.x.x to setuptools==66.0.0 and right now this is the current status whereby the "1.1build1" is an invalid version.

Screenshot 2023-01-16 at 5 03 57 PM

fatraphael95 avatar Jan 16 '23 09:01 fatraphael95

@fatraphael95 you should not have to install main branch, this fix has long since been released in pypi -- noticed you are pip install -r requirements.txt after installing pipenv which could revert back to a version you have specified in the requirements.txt. Do you have a version of pipenv specified there that isn't the latest?

matteius avatar Jan 16 '23 15:01 matteius

@matteius ohh i see and yes it was not the latest version. I have updated the requirement.txt file and it is working now. Thanks a lot for your kind help! :)

fatraphael95 avatar Jan 17 '23 06:01 fatraphael95