Better deps management
This commit is contained in:
parent
518a0a70fe
commit
a30afa2dd6
19
viewer.py
19
viewer.py
|
@ -7,31 +7,34 @@ import os
|
||||||
import math
|
import math
|
||||||
|
|
||||||
# Test dependencies
|
# Test dependencies
|
||||||
|
missing_dependencies = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import PIL
|
import PIL
|
||||||
except:
|
except:
|
||||||
print('You need to install PIL', file=sys.stderr)
|
missing_dependencies.append('pillow')
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pygame as pg
|
import pygame as pg
|
||||||
import pygame.locals as pgl
|
import pygame.locals as pgl
|
||||||
except:
|
except:
|
||||||
print('You need to install pygame', file=sys.stderr)
|
missing_dependencies.append('pygame')
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import OpenGL.GL as gl
|
import OpenGL.GL as gl
|
||||||
import OpenGL.GLU as glu
|
import OpenGL.GLU as glu
|
||||||
except:
|
except:
|
||||||
print('You need to install pyopengl', file=sys.stderr)
|
missing_dependencies.append('pyopengl')
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import numpy
|
import numpy
|
||||||
except:
|
except:
|
||||||
print('You need to install numpy', file=sys.stderr)
|
missing_dependencies.append('numpy')
|
||||||
sys.exit(-1)
|
|
||||||
|
if len(missing_dependencies) > 0:
|
||||||
|
print('You are missing the following dependencies :', file=sys.stderr)
|
||||||
|
for dep in missing_dependencies:
|
||||||
|
print(dep, file=sys.stderr)
|
||||||
|
|
||||||
from d3.model.tools import load_model
|
from d3.model.tools import load_model
|
||||||
from d3.geometry import Vector
|
from d3.geometry import Vector
|
||||||
|
|
Loading…
Reference in New Issue