diff options
author | Isaac <isaclien9752@gmail.com> | 2024-08-24 18:42:19 -0400 |
---|---|---|
committer | Isaac <isaclien9752@gmail.com> | 2024-08-24 18:42:19 -0400 |
commit | 5297d6b2cca54fab12ed62b96df8207f10f8c02c (patch) | |
tree | 90c596001286188b5d0fa33c8902c50f495212a9 /required_modules.py | |
parent | 17fd2304270b2ef619cceb980b9f49cb656a6d13 (diff) | |
download | blenxy-5297d6b2cca54fab12ed62b96df8207f10f8c02c.tar.gz blenxy-5297d6b2cca54fab12ed62b96df8207f10f8c02c.zip |
attempt to make blenxy install its required modules by itself
Diffstat (limited to 'required_modules.py')
-rw-r--r-- | required_modules.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/required_modules.py b/required_modules.py new file mode 100644 index 0000000..98af424 --- /dev/null +++ b/required_modules.py @@ -0,0 +1,36 @@ +# I tried... + +# setup pip with ensurepip if it isn't included +try: + import pip +except: + import ensurepip + ensurepip.bootstrap() + print("First exit!") + exit(0) + +# upgrade pip (check the version installed by ensurepip) +if (int(pip.__version__.split('.')[0]) > 9): + from pip._internal import main +else: + from pip import main + +# 24.0 is the last version for python3.7 +import certifi +if (int(pip.__version__.split('.')[0]) < 24): + main(["install", "--cert", str(certifi.where()), "--upgrade", "--force-reinstall", "pip", "-q"]) + print("Second exit!") + exit(0) +import pip +print("pip %s is installed!" % (pip.__version__)) + +# check if lxml is installed +try: + import lxml +except: + main(["install", "lxml"]) + print("Third exit!") + exit(0) +print("lxml %s is installed!" % (lxml.__version__)) + +# no more exits please... |