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

Ways to fix

votes up 2 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