1# https://pyrocko.org - GPLv3
2#
3# The Pyrocko Developers, 21st Century
4# ---|P------/S----------~Lg----------
6import sys
9def print_version(deps=False):
10 import pyrocko
11 if deps:
12 print('pyrocko: %s' % pyrocko.long_version)
13 try:
14 import numpy
15 print('numpy: %s' % numpy.__version__)
16 except ImportError:
17 print('numpy: N/A')
19 try:
20 import scipy
21 print('scipy: %s' % scipy.__version__)
22 except ImportError:
23 print('scipy: N/A')
25 try:
26 import matplotlib
27 print('matplotlib: %s' % matplotlib.__version__)
28 except ImportError:
29 print('matplotlib: N/A')
31 try:
32 from pyrocko.gui.qt_compat import Qt
33 print('PyQt: %s' % Qt.PYQT_VERSION_STR)
34 print('Qt: %s' % Qt.QT_VERSION_STR)
35 except ImportError:
36 print('PyQt: N/A')
37 print('Qt: N/A')
39 try:
40 import vtk
41 print('VTK: %s' % vtk.VTK_VERSION)
42 except ImportError:
43 print('VTK: N/A')
45 print('python: %s.%s.%s' % sys.version_info[:3])
47 elif sys.argv[1:] == ['short']:
48 print(pyrocko.version)
49 else:
50 print(pyrocko.long_version)
53if __name__ == '__main__':
54 print_version(sys.argv[1:] == ['deps'])