Skip to content

Commit

Permalink
Added missing dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Aug 31, 2020
1 parent 627983f commit 9f053f6
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ def draw(self, context):
Pip._ensure_user_site_package()

layout = self.layout
deps = ['gmsh_api', 'tqdm', 'sklearn', 'scipy', 'numpy']

flag = True
for _module in deps:
flag = flag and importlib.util.find_spec(_module) is not None

if flag:
layout.label(text='Loaded required modules.', icon='INFO')
else:
layout.label(text='anton requires few additional modules.', icon='ERROR')
row = layout.row()
row.operator('anton.installer')
layout.label(text='anton requires few additional modules.', icon='ERROR')
row = layout.row()
row.operator('anton.installer')

class AntonInstaller(bpy.types.Operator):
bl_idname = "anton.installer"
Expand All @@ -37,6 +28,11 @@ def execute(self, context):
Pip.install('scikit-learn')
Pip.install('scipy')
Pip.install('numpy')
Pip.install('pytz')
Pip.install('python-dateutil')
Pip.install('six')
Pip.install('pandas')
Pip.install('joblib')

import gmsh_api
from tqdm import tqdm
Expand Down

0 comments on commit 9f053f6

Please sign in to comment.