Better deps management

This commit is contained in:
Thomas FORGIONE 2017-02-27 15:00:30 +01:00
parent 518a0a70fe
commit a30afa2dd6
No known key found for this signature in database
GPG Key ID: 2A210FFC062E00C3
1 changed files with 11 additions and 8 deletions

View File

@ -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