Search code examples
pythonpippypisemantic-versioning

PIP install not recognizing versions


I have a custom pypi server, that I am installing files from. I attempt to upgrade from version 0.0.1 to a newer version of my own custom module. It is not detecting the later version. When I do a pip install 'mymodule>=17' I see:

Could not find a version that satisfies the requirement mymodule>=17 
(from versions: 17.0828.222133-e1e0fd9, 17.0828.222305-e1e0fd9, 
17.830.210154-e1e0fd9, 0.0.1)

Notice the versions show up, but it will never detect the 17.X versions with the git sha on the end. Ideas? Why would this be?


Solution

  • Due to the hyphen, 17.0828.222133-e1e0fd9 and the like are not valid version specifiers as defined in PEP 440. As a result, they are treated as "legacy version" strings by pip's internals and are sorted less than all valid version strings. Hence, as far as pip is concerned, these versions are not greater than 17.