Search code examples
pythonpipfreezerequirements.txt

Pip freeze shows a weird version of a package


So I was creating the requirements.txt file by using the command :

pip list --format=freeze > requirements.txt

and one of the packages had this as a version : setuptools==52.0.0.post20210125

Why is this so? And will this give an error when I deploy my project on a cloud platform.


Solution

  • As @Corralien pointed out it's not that weird to have a post-release version of something: https://www.python.org/dev/peps/pep-0440/#version-scheme

    Post-releases are usually made to make some minor change to the released package that does not affect the code necessarily (e.g. a typo in the readme, or some other minor packaging bug).

    It is a little weird in this case because on PyPI there is no 52.0.0.post20210125 release for setuptools. There is, however, a 51.1.0.post20201221 release which was apparently made by mistake.

    I don't know how you ended up with the one you have though. It does not appear to exist (maybe it was deleted).

    You should try upgrading setuptools before freezing your pip environment since the one you have is outdated anyways.