-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidVersion
exception when invalid version used on Setuptools 66
#3772
Comments
I'm also facing this error |
This issue is by design (#2497). Non-conformant versions have been discouraged since ~2014, deprecated in packaging since late 2020 and deprecated in Setuptools since Oct 2021. Projects should adapt to provide conformant versions (i.e. Unfortunately, deprecation and removal is the main way I know to inform downstream consumers of breaking changes like these. If the disruption is too great or the workarounds aren't suitable, this project may consider backing out the changes for another limited period, but only as a mitigation measure. Please first explore mitigation measures, such as pinning
Please use the thumbs-up on the original post to register that this issue also affects your project. |
Quick note that in some cases internal dependencies several steps down the chain from the package I'm using are bringing in the new version of |
I'm getting this issue when I'm using setup.py with https://github.com/pypa/setuptools_scm
With setuptools
When I roll back the setuptools version to |
If I am not mistaken, using a virtual environment should work (since all the packages with offending versions seem to come via |
I have the same issue with pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.23.0-test.1.2.3'
EDIT: this happens inside venv (unlike OP) $ which python
/c/USERS/foobar/.virtualenvs/venv-3.8/Scripts/python EDIT 2:
|
The setuptools v66.0.0 package has removed support for legacy version strings that don't conform to PEP 440. Due to a wrong version number used in 'python3-distro-info' and 'python-debian' Ubuntu packages, the installation of packages from PyPI is broken by the above change. To mitigate this before the Ubuntu packages are fixed, the 'setuptools' PyPI package will be installed using the latest known version to support legacy version numbers. Ref: pypa/setuptools#3772
The setuptools v66.0.0 package has removed support for legacy version strings that don't conform to PEP 440. Due to a wrong version number used in 'python3-distro-info' and 'python-debian' Ubuntu packages, the installation of packages from PyPI is broken by the above change. To mitigate this before the Ubuntu packages are fixed, the 'setuptools' PyPI package will be installed using the latest known version to support legacy version numbers. Ref: pypa/setuptools#3772 (cherry picked from commit aec04c8)
The setuptools v66.0.0 package has removed support for legacy version strings that don't conform to PEP 440. Due to a wrong version number used in 'python3-distro-info' and 'python-debian' Ubuntu packages, the installation of packages from PyPI is broken by the above change. To mitigate this before the Ubuntu packages are fixed, the 'setuptools' PyPI package will be installed using the latest known version to support legacy version numbers. Ref: pypa/setuptools#3772 (cherry picked from commit aec04c8)
The setuptools v66.0.0 package has removed support for legacy version strings that don't conform to PEP 440. Due to a wrong version number used in 'python3-distro-info' and 'python-debian' Ubuntu packages, the installation of packages from PyPI is broken by the above change. To mitigate this before the Ubuntu packages are fixed, the 'setuptools' PyPI package will be installed using the latest known version to support legacy version numbers. Ref: pypa/setuptools#3772 (cherry picked from commit aec04c8) (cherry picked from commit 70cc9ef)
Since the error message is somewhat cryptic (it would help if it also printed out the offending package in addition to the version), I dug around a bit to help match the version from the error message to the package that caused them:
|
Currently, the sdist version fails to install because of an update of setuptools: pypa/setuptools#3772. The wheel is not affected by this change. Depending on the output of the setuptools ticket, we may have to follow-up to provide a valid version scheme for the sdist package.
When I am in a context where I face this error and still want a custom tag. I use the '+' sign (which you can see from jaraco comment.** For example, lets say I want mycode-1.0<CUSTOM_TAG> Assuming I want my custom tag to be win_bob I set my version to mycode-1.0+win_bob Which is then interpreted as mycode-1.0+win.bob. For my needs, this is acceptable. Check https://peps.python.org/pep-0440/#local-version-segments for more information. |
A change to setuptools requires conformant version formats; see pypa/setuptools#3772. CATCH could not be installed with `pip install` using newer versions of setuptools.
Switching to setuptools 65 solved it for me, now I have new error. |
Can we make a list of libraries like this that break their clients and then cause breakages everywhere in the python ecosystem? There's no regard for the end user, I think a list would be good so that the libraries I use wont break when setuptools decides to become pedantic about something. |
Because Setup Tools doesn't support the ~pre suffix anymore: - https://stackoverflow.com/a/75671981/470844 - pypa/setuptools#3772 (comment)
Because Setup Tools doesn't support the ~pre suffix anymore: - https://stackoverflow.com/a/75671981/470844 - pypa/setuptools#3772 (comment)
even after downgrading the version of setuptools im still getting version exception, any suggestions. |
Same here. The issue has shown up in my codebase in the last 3 days, and I have made no changes other than updating to the latest packages available in Pip. I update my packages before every build, so I would have been using the latest packages 4 days ago, and things were fine then. |
I too cannot make this work with a downgraded setuptools. My usecase is trying to run
|
This is back again with setuptools 75.3.0:
|
I resolved my issue, the problem was due to pip, i had to set pip to 20.3.3, im using python 3.8, setuptools 65.7.0 anything less than 66. |
Thanks, but that didn't help me. I've tried pip==20.3.3, setuptools=58.0.4 and it's still broken. |
setuptools version
66.0.0
Python version
3.8
OS
Ubuntu 20.04
Additional environment information
only happening when not running inside a venv
Description
Trying to install certain pip packages like e.g. ssdeep results in an
pkg_resources.extern.packaging.version.InvalidVersion
exception. This seems to be related to this bug where certain ubuntu/debian packages install python packages (in this casepython3-distro-info
andpython-debian
) with versions that don't conform to PEP 440Expected behavior
With setuptools <66.0.0 this does not cause an error
How to Reproduce
Output
The text was updated successfully, but these errors were encountered: