-
Notifications
You must be signed in to change notification settings - Fork 13
/
check_dependencies.py
executable file
·57 lines (52 loc) · 1.57 KB
/
check_dependencies.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
#
#+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!
# #
# check_dependencies.py #
# #
#+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!+!
#
# Author: Pat Prodanovic, Ph.D., P.Eng.
#
# Date: Nov 21, 2016
#
# Purpose: Checks if numpy, scipy and matplotlib dependencies are
# installed on the system. If they are, their version is printed.
#
# Uses: Python 2 or 3
#
# Example:
#
# python check_dependencies.py
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Global Imports
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# to print the pputils ascii logo
#
print(' ____ ____ __ __ ______ ____ __ _____')
print(' / __ \ / __ \ / / / //_ __// _// / / ___/')
print(' / /_/ // /_/ // / / / / / / / / / \__ \ ')
print(' / ____// ____// /_/ / / / _/ / / /___ ___/ / ')
print('/_/ /_/ \____/ /_/ /___//_____//____/ ')
print(' ')
import sys
try:
import numpy as np
print('Numpy version: ' + str(np.__version__))
except:
print('Numpy not installed. Exiting.')
sys.exit(0)
try:
import scipy as sp
print('Scipy version: ' + str(sp.__version__))
except:
print('Scipy not installed. Exiting.')
sys.exit(0)
try:
import matplotlib as mpl
print('Matplotlib version: ' + str(mpl.__version__))
except:
print('Matplotlib not installed. Exiting.')
sys.exit(0)