diff options
author | Isaac <isaclien9752@gmail.com> | 2024-08-25 17:32:04 -0400 |
---|---|---|
committer | Isaac <isaclien9752@gmail.com> | 2024-08-25 17:32:04 -0400 |
commit | 242325c20bcad3fc12f710574dad795b14e9aea5 (patch) | |
tree | afa657bd6119b573c3c715cd5df74423313a7aad /required_modules.py | |
parent | 621b80b977b6e89e31e8a3b7c4fd636cff52fb1b (diff) | |
download | blenxy-242325c20bcad3fc12f710574dad795b14e9aea5.tar.gz blenxy-242325c20bcad3fc12f710574dad795b14e9aea5.zip |
ok
Diffstat (limited to 'required_modules.py')
-rw-r--r-- | required_modules.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/required_modules.py b/required_modules.py index 6049839..06661c5 100644 --- a/required_modules.py +++ b/required_modules.py @@ -1,27 +1,28 @@ -import bpy +import bpy, sys from subprocess import run # get python's binary path (literally my saviour) py_bin = bpy.app.binary_path_python -req_mods = ["lxml"] +upd_mods = ["wheel", "setuptools"] trusted_hosts = ["--trusted-host", "pypi.python.org", "--trusted-host", "files.pythonhosted.org", "--trusted-host", "pypi.org"] try: import pip - import setuptools import lxml except: # hecking install pip (ensurepip) + required modules run([py_bin, "-m", "ensurepip"]) - # update pip and setuptools to latest version + # update pip, setuptools and pyinstaller to latest version run([py_bin, "-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"] + trusted_hosts) - run([py_bin, "-m", "pip", "install", "--upgrade", "setuptools"] + trusted_hosts) - # install required modules - run([py_bin, "-m", "pip", "install"] + req_mods + trusted_hosts) + run([py_bin, "-m", "pip", "install", "--upgrade"] + upd_mods + trusted_hosts) + # install required modules depending on python version + if (sys.version_info.minor == 5): # blender 2.79b + run([py_bin, "-m", "pip", "install", "lxml==4.9.3"] + trusted_hosts) + else: # blender 2.79 latest + run([py_bin, "-m", "pip", "install", "lxml"] + trusted_hosts) print("First exit!") - exit(0) + exit(0) # print module's versions installed print("pip %s is installed!" % (pip.__version__)) -print("setuptools %s is installed!" % (pip.__version__)) print("lxml %s is installed!" % (lxml.__version__)) |