votes up 6

got_ver is None

Package:
Exception Class:
ValueError

Raise code

    ">=": operator.ge,
    ">": operator.gt,
}


def _compare_versions(op, got_ver, want_ver, requirement, pkg, hint):
    if got_ver is None:
        raise ValueError("got_ver is None")
    if want_ver is None:
        raise ValueError("want_ver is None")
    if not ops[op](version.parse(got_ver), version.parse(want_ver)):
        raise ImportError(
            f"{requirement} is required for a normal functioning of this module, but found {pkg}=={got_ver}.{hint}"
        )
😲 Agile task management is now easier than calling a taxi. #Tracklify
🙏 Scream for help to Ukraine
Today, 2nd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 1 votes down

Error Code:

import transformers.util.versions
transformers.util.versions._compare_versions("<", None, None, "transformers", "transformers", None)

Fix Code:

import transformers.util.versions
transformers.util.versions._compare_versions("<", "1.0", "1.5", "transformers", "transformers", None)

Explanation:

function _.compare_versions requires the arguments got_ver ("1.0") and want_ver ("1.5") otherwise it throws an exception. generally you do not want to call this function directly as it is a private function

May 29, 2021 axujen answer
axujen 114

Add a possible fix

Please authorize to post fix