-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall_deps.py
More file actions
30 lines (25 loc) · 777 Bytes
/
install_deps.py
File metadata and controls
30 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pathlib
import sys
from pip._internal import main
from .app.controller.estacas import msgLog
import platform
is_windows = any(platform.win32_ver())
plugin_dir = pathlib.Path(__file__).parent
sys.path.append(plugin_dir)
requirements=["OpenGL"]
try:
import OpenGL
except:
#with open(str(plugin_dir / 'requirements.txt'), "r") as requirements:
requirements=["PyOpenGL" "PyOpenGL_accelerate"]
for dep in requirements.readlines():
#dep = dep.strip().split("==")[0]
try:
__import__(dep)
except:
msgLog("{} not available, installing".format(dep))
if is_windows:
main.main(['install', dep])
else:
main(['install', dep])
msgLog("Dependências checadas!")