From 76bd5cc4427c3b0a1baef4476f0d3603e1b4f5fe Mon Sep 17 00:00:00 2001 From: tin2tin Date: Tue, 21 Mar 2023 15:45:21 +0100 Subject: [PATCH] Update __init__.py --- __init__.py | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/__init__.py b/__init__.py index 562e0eb..0082c6d 100644 --- a/__init__.py +++ b/__init__.py @@ -62,34 +62,28 @@ class SequencerImportMovieOperator(Operator): sys.path.append(app_path) pybin = sys.executable - try: - subprocess.call([pybin, "-m", "ensurepip"]) - except ImportError: - pass + import_module(self, "open_clip_torch") + import_module(self, "pytorch_lightning") + import_module(self, "gast") + import_module(self, "tensorflow") - subprocess.check_call( - [ - pybin, - "-m", - "pip", - "install", - "git+https://github.com/modelscope/modelscope.git", - "--user", - ] - ) try: import modelscope except ModuleNotFoundError: - print("Installation of the modelscope module failed") - self.report( - {"INFO"}, - "Installing modelscope module failed! Try to run Blender as administrator.", + try: + subprocess.call([pybin, "-m", "ensurepip"]) + except ImportError: + pass + subprocess.check_call( + [ + pybin, + "-m", + "pip", + "install", + "git+https://github.com/modelscope/modelscope.git", + "--user", + ] ) - return False - import_module(self, "open_clip_torch") - import_module(self, "pytorch_lightning") - import_module(self, "gast") - import_module(self, "tensorflow") from modelscope.pipelines import pipeline from modelscope.outputs import OutputKeys