Skip to content

Commit

Permalink
Ensure pip #1
Browse files Browse the repository at this point in the history
  • Loading branch information
UuuNyaa committed Dec 30, 2022
1 parent a50e2b6 commit e598afe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion motion_generate_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
bl_info = {
"name": "motion_generate_tools",
"author": "UuuNyaa",
"version": (0, 0, 1),
"version": (0, 0, 3),
"blender": (3, 3, 0),
"location": "View3D > Sidebar > Panel",
"description": "Utility tools for motion generating.",
Expand Down
45 changes: 25 additions & 20 deletions motion_generate_tools/setup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,36 @@ def delete_clip_model():

def install_python_modules(use_gpu=False, line_callback: Optional[LineCallback] = None, finally_callback: Optional[FinallyCallback] = None):
_get_command_executor().exec_command(
# force install setuptools
sys.executable, '-m', 'pip', 'install',
'--disable-pip-version-check',
'--no-input',
'--ignore-installed',
'setuptools',
# ensurepip
sys.executable, '-m', 'ensurepip',
line_callback=line_callback,
finally_callback=lambda e: e.exec_command(
# and then install depending modules
# force install setuptools
sys.executable, '-m', 'pip', 'install',
'--disable-pip-version-check',
'--no-input',
'--upgrade',
# '--upgrade-strategy', 'only-if-needed',
# '--no-cache-dir',
'--exists-action', 'i',
# '--ignore-installed',
'--extra-index-url', 'https://download.pytorch.org/whl/cu116' if use_gpu else 'https://download.pytorch.org/whl/cpu',
'torch',
'numpy<1.24.0',
'git+https://github.com/openai/CLIP.git',
'smplx',
'scipy',
'chumpy',
line_callback=line_callback, finally_callback=finally_callback
'--ignore-installed',
'setuptools',
line_callback=line_callback,
finally_callback=lambda e: e.exec_command(
# and then install depending modules
sys.executable, '-m', 'pip', 'install',
'--disable-pip-version-check',
'--no-input',
'--upgrade',
# '--upgrade-strategy', 'only-if-needed',
# '--no-cache-dir',
'--exists-action', 'i',
# '--ignore-installed',
'--extra-index-url', 'https://download.pytorch.org/whl/cu116' if use_gpu else 'https://download.pytorch.org/whl/cpu',
'torch',
'numpy<1.24.0',
'git+https://github.com/openai/CLIP.git',
'smplx',
'scipy',
'chumpy',
line_callback=line_callback, finally_callback=finally_callback
)
)
)

Expand Down

0 comments on commit e598afe

Please sign in to comment.