install_blender_python_modules
install_blender_python_modules copied to clipboard
Error in installModule function
This line is not working on Windows, with blender 4.5 :
subprocess.call([python_exe, "import ", packageName])
Here is a suggestion for fixing this
def installModule(packageName):
python_exe = python_exec()
try:
subprocess.check_call([python_exe, "-c", f"import {packageName}"])
except:
# upgrade pip
try:
subprocess.check_call([python_exe, "-m", "ensurepip", "--default-pip"])
except:
pass # ensurepip can fail if not already installed
# install required packages
subprocess.check_call([python_exe, "-m", "pip", "install", "--upgrade", "pip"])
subprocess.check_call([python_exe, "-m", "pip", "install", packageName])