Don't rely on external packages

Since version.py is used at install time.
Merge pull request #18071 from s0undt3ch/hotfix/no-external-deps

Don't rely on external packages