Your code for ensure_python is doing an eval(part + spec), which for spec =">=3.5" and a python version 3.10 ends up being eval("3.10>=3.5"), to check for whether it's compatible. But that's not how software versioning works, 3.10 != 3.1 which is what the eval is treating is as when running.
Your code for ensure_python is doing an eval(part + spec), which for spec =">=3.5" and a python version 3.10 ends up being eval("3.10>=3.5"), to check for whether it's compatible. But that's not how software versioning works, 3.10 != 3.1 which is what the eval is treating is as when running.